Class ReactiveTokenAuthenticationConverter

java.lang.Object
com.sap.cloud.security.xsuaa.token.ReactiveTokenAuthenticationConverter
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,reactor.core.publisher.Mono<org.springframework.security.authentication.AbstractAuthenticationToken>>

public class ReactiveTokenAuthenticationConverter extends Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,reactor.core.publisher.Mono<org.springframework.security.authentication.AbstractAuthenticationToken>>
Encapsulates the TokenAuthenticationConverter that extracts authorization related information from the Jwt token. For example theLocalAuthoritiesExtractor can remove the ugly application id prefix (e.g.my-application-demo!t1229) from the scopes in the JWT.
  • Constructor Details

    • ReactiveTokenAuthenticationConverter

      public ReactiveTokenAuthenticationConverter(XsuaaServiceConfiguration xsuaaServiceConfiguration)
  • Method Details

    • setLocalScopeAsAuthorities

      public ReactiveTokenAuthenticationConverter setLocalScopeAsAuthorities(boolean extractLocalScopesOnly)
      This method allows to overwrite the default behavior of the Token.getAuthorities() implementation.
      Parameters:
      extractLocalScopesOnly - * true when Token.getAuthorities() should only extract local * scopes. Local scopes means that non-application specific scopes * are filtered out and scopes are returned without appId prefix, * e.g. "Display". Creates a new converter with a new * LocalAuthoritiesExtractor
      Returns:
      the token authenticator itself
    • convert

      public reactor.core.publisher.Mono<org.springframework.security.authentication.AbstractAuthenticationToken> convert(org.springframework.security.oauth2.jwt.Jwt jwt)
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,reactor.core.publisher.Mono<org.springframework.security.authentication.AbstractAuthenticationToken>>