SampleSampletypeA worked example you read or clone. Evidence: it demonstrates, it never provides.See every one →What this type is →by SAPby SAPoriginPublished by SAP itself. A visible facet, never an input to a reading — a dormant official plugin reads exactly like a dormant independent one.See every one →Reference

SAP-samples/ams-samples-java

Sample Java applications, on Javalin, Spring Boot and CAP Java, showing policy-based authorization through the Authorization Management Service on SAP BTP, with DCL policies checked against JWT tokens.

Covers three Java frameworks against the same Authorization Management Service (AMS) v4 Core API: a Javalin app, a Spring Boot app using AMS's Spring Security integration, and a Spring Boot app built on SAP CAP Java, each authenticating through the SAP Cloud Identity Services and authorizing with JWT tokens checked against DCL policy files. Older v3-based samples are kept in a legacy-v3-samples directory for reference; the maintainers recommend v4 for new projects and migrating existing v3 projects.

Facts

Last pushLicenceApache-2.0

Where it sits

Lives in
Demonstrates
AuthorizationBTPAuthorizationcapabilityDeciding who may read or change what, at service, entity and instance level — role checks, forwarded user context, and restrictions evaluated as query filters rather than after the fact.

Who is behind it

SAP SamplesSAP SamplesOrganisationMaintains this
In the atlas: maintains 222
@SAP-samples
maintainerAndre MeyeringPersonContributes to this
In the atlas: contributes to 10
@bugwelle
f-blassPersonContributes to this
In the atlas: contributes to 2
@f-blass
Manuel FinkPersonContributes to this
In the atlas: contributes to 3
@finkmanAtSap
Johannes KratzschPersonContributes to this
In the atlas: contributes to 1
@johanneskra
Daniel KuntzePersonContributes to this
In the atlas: contributes to 2
@kuntzed
LīgaPersonContributes to this
In the atlas: contributes to 1
@liga-oz
NiklasHerrmann21PersonContributes to this
In the atlas: contributes to 1
@NiklasHerrmann21
Matthias BühlPersonContributes to this
In the atlas: contributes to 2
@pianocktail
SAP-MartinNaumannPersonContributes to this
In the atlas: contributes to 1
@SAP-MartinNaumann
timolasiPersonContributes to this
In the atlas: contributes to 1
@timolasi
10 contributors

What it declares

Every artifact

Type
Sample
Origin
By SAP
Use as
A reference

As a sample

Form
A reference application

Connections1

SAP-samples/ams-samples-java connectionsSAP-samples/ams-samples-javaPROVIDES→ demonstrates1demonstrates authoredAuthorization

README

quoted from SAP-samples/ams-samples-java under Apache-2.0, read
SAP-samples/ams-samples-java/README.mdOn GitHub

REUSE status

Overview: Authorization Management Service (AMS) Java Samples

This repository brings together several sample applications that demonstrate how to integrate the SAP Authorization Management Service (AMS) into various Java frameworks. Each sample showcases different architectures and scenarios for authentication and authorization using AMS and the SAP Identity Authentication Service (IAS).

⚠️ Important Version Notice

These samples use major version 4. The older version 3 samples have been moved to the legacy-v3-samples directory. We strongly recommend:

  • ✅ Use v4 for all new projects
  • ✅ Upgrade existing v3 projects to v4
  • ❌ Do not start new projects with v3

Repository Structure and Sample Overview

Sample NameDescriptionDirectory
Javalin Shopping SampleA lightweight application using Javalin (minimal web framework) to showcase the AMS v4 Core APIams-javalin-shopping
Spring Boot Shopping SampleA Spring Boot application to showcase AMS Spring Security integrationams-spring-boot-shopping
CAP Spring Boot Bookshop SampleDemonstrates the integration of AMS into a SAP CAP Java Spring Boot applicationams-cap-bookshop

Sample Details

1. Javalin Shopping Sample (ams-javalin-shopping)
  • Framework: Javalin (lightweight Java web framework)
  • Highlights:
    • Minimal web framework approach with AMS Core API v4
    • AMS and IAS integration for securing REST APIs via JWT tokens
    • Clean, straightforward implementation ideal for learning AMS basics
    • Simple shopping application example
  • More info: Javalin Shopping Sample
2. Spring Boot Shopping Sample (ams-spring-boot-shopping)
  • Framework: Spring Boot
  • Highlights:
    • AMS Core API v4 integration with Spring Boot
    • AMS and IAS integration for securing REST APIs via JWT tokens
    • Shopping application with Spring Security integration
  • More info: Spring Boot Shopping Sample
3. CAP Spring Boot Bookshop Sample (ams-cap-bookshop)
  • Framework: SAP Cloud Application Programming Model (CAP) for Java
  • Highlights:
    • Demonstrates AMS Core API v4 integration in a CAP Java project (bookshop sample)
    • Contains instructions for both local development and cloud deployment
  • More info: CAP Bookshop Sample

Legacy Samples (v3)

The legacy-v3-samples directory contains samples for AMS Core API v3. These are maintained for reference but are not recommended for new projects:

  • spring-security-ams - Spring Boot sample with v3 API
  • jakarta-ams-sample - Jakarta EE sample with v3 API
  • ams-cap-sample - CAP Java sample with v3 API
  • ams-ztis-sample - Jakarta EE Zero Trust sample with v3 API

Please migrate to v4 for new development and consider upgrading existing v3 projects.


What Can You Learn From These Samples?

  • AMS API integration across different Java frameworks
  • Policy and access management using AMS and DCL files
  • JWT-based authentication with IAS (Identity Authentication Service)

Further References


Licenses

This repository is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Apache-2.0, read

Details

Sources3
Added by handdiscovered herechecked
github.com/SAP-samples/ams-samples-javatree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainbtp, security-and-compliance
Contributors10
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:sap-samples-ams-samples-java
JSON
/artifacts/sap-samples-ams-samples-java.json
MCP
Connecting an agent