GithubHelp home page GithubHelp logo

isabella232 / cloud-security-xsuaa-integration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sap/cloud-security-services-integration-library

0.0 0.0 0.0 7.11 MB

Integration libraries and samples for authenticating users and clients bound to XSUAA authentication and authorization service or identity authentication service.

License: Apache License 2.0

Java 99.39% PowerShell 0.37% Shell 0.24%

cloud-security-xsuaa-integration's Introduction

REUSE status Java CI with Maven Language grade: Java Fosstars security rating

Description

Authentication services provided by the xsuaa service on SAP Cloud Platform or SAP HANA XS Advanced rely on usage of the OAuth 2.0 protocol and OAuth 2.0 access tokens.

Web Flow for Authentication

Typical UI5 applications consist of a server providing the HTML content and one or more application serving REST APIs used by the application. Web application use the OAuth Authorization Code Flow for interactive authentication:

  1. A user accesses the web application using a browser or mobile device
  2. The web application (in typical SAP Cloud Platform applications, this is an application router) acts as OAuth client and redirects to the OAuth server for authorization
  3. Upon authentication, the web application uses the code issued by the authorization server to request an access token
  4. The web application uses the access token to request data from the OAuth resource server. The OAuth resource server validates the token using online or offline validation.

OAuth 2.0 Authorization code flow

OAuth resource servers (as the one in step 4) require libraries for validating access tokens.

Token Validation for Java web applications using SAP Java Buildpack

The SAP Java Buildpack integrates token validation into the tomcat server. Application developers requiring authentication and authorization information in their application use the interfaces defined in java-api to obtain information like user name and scopes.

Requirements

  • Java 8 or 11
  • maven 3.3.9 or later
  • You use sap_java_buildpack (e.g. in your manifest.yml)

Sample

See sap-java-builpack-api-usage for an example.

Changes with SAP Java Buildpack 1.26.0

The former SAP Java Buildpack versions have used deprecated (Spring) Security libraries and had to be updated. As of version 1.26.0 SAP Java Buildpack uses the java-security library. Please consider these (migration) guides:

Token Exchange for Java applications

Applications requiring access tokens (Jwt) use the Token Flows API defined in token-client to obtain Jwt tokens for their clients (applications) or for their users.

Requirements

  • Java 8 or 11
  • maven 3.3.9 or later

Sample

Token Validation for Java applications

Application developers requiring authentication and authorization information in their application use the libraries defined in java-security to obtain token information like user name.

Requirements

  • Java 8 or 11
  • maven 3.3.9 or later

Sample

See java-security-usage for an example.

Additional (test) utilities

  • java-security-test offers test utilities to generate custom JWT tokens for the purpose of tests. It pre-configures a WireMock web server to stub outgoing calls to the identity service (OAuth resource-server), e.g. to provide token keys for offline token validation. Its use is only intended for JUnit tests.

Token Validation for Java Spring Boot web applications

Spring Boot provides OAuth resource servers. Application developers requiring authentication and authorization information in their application use the libraries defined in spring-security to obtain token information like user name and scopes.

Requirements

  • Java 8 or 11
  • maven 3.3.9 or later
  • as of version 2.6.1 Spring Boot >= 2.2 is required. Consequently, it also requires Spring Security version >= 5.2

Sample

Additional (test) utilities

  • java-security-test offers test utilities to generate custom JWT tokens for the purpose of tests. It pre-configures a WireMock web server to stub outgoing calls to the identity service (OAuth resource-server), e.g. to provide token keys for offline token validation. Its use is only intended for JUnit tests.

Download and Installation

Build results are published to maven central: https://search.maven.org/search?q=com.sap.cloud.security

To download and install this project clone this repository via:

git clone https://github.com/SAP/cloud-security-xsuaa-integration
cd cloud-security-xsuaa-integration
mvn clean install

Note: Use this if you want to enhance this xsuaa integration libraries. The build results are also available on maven central.

Limitations

Libraries and information provided here is around the topic of integrating with the SAP xsuaa and identity service. General integration into other OAuth authorization servers is not the primary focus.

How to obtain support

Open an issue in GitHub.

Licensing

Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.

cloud-security-xsuaa-integration's People

Contributors

abiskop avatar alstolten avatar atla avatar braunmatthias avatar davidnazw avatar dependabot[bot] avatar dergutewolf avatar dirkrichtsteiger avatar eaglerainbow avatar essenpreis avatar firnkes avatar gregorwolf avatar hassler-d avatar ilijanavonderweth avatar irfanmohammad2010 avatar j-denner avatar johannes-staehlin avatar jonathanbaker7 avatar liga-oz avatar m-ignatov avatar mblst avatar mwdb avatar nedo85 avatar nenaraab avatar newtork avatar rahuldeepattri avatar rroggia avatar strehle avatar stueberma avatar vtintillier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.