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 ServicesCloud Identity ServicesIdentity Authentication and Identity Provisioning as one tenant: the login, the user store or the federation to a corporate identity provider, and the provisioning of users into whatever sits behind it.sap official, btp 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
Where it sits
Who is behind it
In the atlas: maintains 222@SAP-samplesmaintainerAndre MeyeringContributes to this
In the atlas: contributes to 10@bugwellef-blassContributes to this
In the atlas: contributes to 2@f-blassManuel FinkContributes to this
In the atlas: contributes to 3@finkmanAtSapJohannes KratzschContributes to this
In the atlas: contributes to 1@johanneskraDaniel KuntzeContributes to this
In the atlas: contributes to 2@kuntzedLīgaContributes to this
In the atlas: contributes to 1@liga-ozNiklasHerrmann21Contributes to this
In the atlas: contributes to 1@NiklasHerrmann21Matthias BühlContributes to this
In the atlas: contributes to 2@pianocktailSAP-MartinNaumannContributes to this
In the atlas: contributes to 1@SAP-MartinNaumanntimolasiContributes to this
In the atlas: contributes to 1@timolasi10 contributors
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
- Use as
- A reference
As a sample
- Form
- A reference application
Connections
Deciding who may read or change what, down to instance level
Download
README
quoted from SAP-samples/ams-samples-java under Apache-2.0, readOverview: 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 Name | Description | Directory |
|---|---|---|
| Javalin Shopping Sample | A lightweight application using Javalin (minimal web framework) to showcase the AMS v4 Core API | ams-javalin-shopping |
| Spring Boot Shopping Sample | A Spring Boot application to showcase AMS Spring Security integration | ams-spring-boot-shopping |
| CAP Spring Boot Bookshop Sample | Demonstrates the integration of AMS into a SAP CAP Java Spring Boot application | ams-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 APIjakarta-ams-sample- Jakarta EE sample with v3 APIams-cap-sample- CAP Java sample with v3 APIams-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.
Details
Sources
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
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-samples-ams-samples-java- JSON
- /artifacts/sap-samples-ams-samples-java.json
- MCP
- Connecting an agent