Class XsuaaJwtDecoderBuilder
java.lang.Object
com.sap.cloud.security.xsuaa.token.authentication.XsuaaJwtDecoderBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionXsuaaJwtDecoderBuilder(XsuaaServiceConfiguration configuration) Utility for building a JWT decoder configuration -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.jwt.JwtDecoderbuild()Assembles a JwtDecoderorg.springframework.security.oauth2.jwt.ReactiveJwtDecoderAssembles a ReactiveJwtDecoderwithDecoderCacheSize(int size) Overwrite size of cached decoder (default: 100).withDecoderCacheTime(int timeInSeconds) Decoders cache the signing keys.Disables the JWTXsuaaAudienceValidatorwhich is enabled by default.withPostValidationActions(PostValidationAction... postValidationActions) Sets the PostValidationActions that are executed after successful verification and validation of the token.withRestOperations(org.springframework.web.client.RestOperations restOperations) Sets theRestOperationsinstance which is used by the JwtDecoder to perform HTTP requests.withTokenValidators(org.springframework.security.oauth2.core.OAuth2TokenValidator<org.springframework.security.oauth2.jwt.Jwt>... tokenValidators) Configures clone token validator, in case of two xsuaa bindings (application and broker plan).
-
Constructor Details
-
XsuaaJwtDecoderBuilder
Utility for building a JWT decoder configuration- Parameters:
configuration- of the Xsuaa service
-
-
Method Details
-
build
public org.springframework.security.oauth2.jwt.JwtDecoder build()Assembles a JwtDecoder- Returns:
- JwtDecoder
-
buildAsReactive
public org.springframework.security.oauth2.jwt.ReactiveJwtDecoder buildAsReactive()Assembles a ReactiveJwtDecoder- Returns:
- ReactiveJwtDecoder
-
withDecoderCacheTime
Decoders cache the signing keys. Overwrite the cache time (default: 900 seconds).- Parameters:
timeInSeconds- time to cache the signing keys- Returns:
- this
-
withDecoderCacheSize
Overwrite size of cached decoder (default: 100). Mainly relevant for multi tenant applications.- Parameters:
size- number of cached decoders- Returns:
- this
-
withPostValidationActions
public XsuaaJwtDecoderBuilder withPostValidationActions(PostValidationAction... postValidationActions) Sets the PostValidationActions that are executed after successful verification and validation of the token.- Parameters:
postValidationActions- the PostValidationActions- Returns:
- this
-
withTokenValidators
public XsuaaJwtDecoderBuilder withTokenValidators(org.springframework.security.oauth2.core.OAuth2TokenValidator<org.springframework.security.oauth2.jwt.Jwt>... tokenValidators) Configures clone token validator, in case of two xsuaa bindings (application and broker plan).- Parameters:
tokenValidators- the token validators- Returns:
- this
-
withRestOperations
public XsuaaJwtDecoderBuilder withRestOperations(org.springframework.web.client.RestOperations restOperations) Sets theRestOperationsinstance which is used by the JwtDecoder to perform HTTP requests. This does not effect theReactiveJwtDecoderthat is constructed withbuildAsReactive()- Parameters:
restOperations- theRestOperationsinstance.- Returns:
- the builder itself.
-
withoutXsuaaAudienceValidator
Disables the JWTXsuaaAudienceValidatorwhich is enabled by default.- Returns:
- the builder itself.
-