Skip to main content

Integrating different authorization servers

The jEAP Security library relies on the OpenID Connect / OAuth2 standards for the authentication and authorization of users. Accordingly, the library is generally compatible with authorization servers implementing these standards. Within these standards, the jEAP Security library defines a specific role concept and a matching structure of OAuth2 access tokens. Ideally, the authorization server in use can be configured to issue access tokens directly in the form expected by the jEAP Security library. As this is not always possible, the jEAP Security library provides an extension point through which the access tokens issued by an authorization server can be transformed into the format expected by the jEAP Security library. This allows the jEAP Security library to be used together with authorization servers that cannot be configured to issue access tokens in the format required by the library. The following sections describe how such an authorization server can be successfully integrated with the jEAP Security library.

Transforming access tokens with claim set converters​

jEAP Security allows configuring one claim set converter per configured authorization server or B2B gateway. With a claim set converter, the claims of an access token can be adapted for further processing by Spring Security. The adaptations take place after the signature of the access token has been validated.

With the help of a claim set converter, access tokens with claims other than those expected by jEAP Security can be made suitable for jEAP Security. To do so, the claims expected by jEAP Security must be derived from other claims of the token. For example, the userroles claim expected by jEAP Security could be derived from a role claim in tokens issued by a certain authorization server.

The claims jEAP Security expects in a token are described in Tokens in the Blueprint Microservice.

Configuration​

A claim set converter for the tokens of an authorization server or B2B gateway is activated with the option claim-set-converter-name in the authorization server or B2B gateway configuration:

Configuration propertyAffected tokensConfigurationExample
jeap.security.oauth2.resourceserver.authorization-server.claim-set-converter-nameAuthorization serverSpring bean nameeiamClaimSetConverter
jeap.security.oauth2.resourceserver.auth-servers[n].claim-set-converter-nameAuthorization server at list index nSpring bean nameeiamClaimSetConverter
jeap.security.oauth2.resourceserver.b2b-gateway.claim-set-converter-nameB2B gatewaySpring bean nameb2bClaimSetConverter

Implementing your own claim set converter​

A claim set converter is a normal Spring converter that maps a claim set to another claim set. The implementation must be exposed as a Spring bean and is then activated with the configuration properties described above by naming the converter bean.

See How to: implement a custom claim set converter for the implementation steps, a worked example (EiamClaimSetConverter), and how to activate it.