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 Summary
ConstructorsConstructorDescriptionReactiveTokenAuthenticationConverter(XsuaaServiceConfiguration xsuaaServiceConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<org.springframework.security.authentication.AbstractAuthenticationToken>convert(org.springframework.security.oauth2.jwt.Jwt jwt) setLocalScopeAsAuthorities(boolean extractLocalScopesOnly) This method allows to overwrite the default behavior of theToken.getAuthorities()implementation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.convert.converter.Converter
andThen
-
Constructor Details
-
ReactiveTokenAuthenticationConverter
-
-
Method Details
-
setLocalScopeAsAuthorities
public ReactiveTokenAuthenticationConverter setLocalScopeAsAuthorities(boolean extractLocalScopesOnly) This method allows to overwrite the default behavior of theToken.getAuthorities()implementation.- Parameters:
extractLocalScopesOnly- * true whenToken.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:
convertin interfaceorg.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,reactor.core.publisher.Mono<org.springframework.security.authentication.AbstractAuthenticationToken>>
-