Class XsuaaJwtDecoderBuilder

java.lang.Object
com.sap.cloud.security.xsuaa.token.authentication.XsuaaJwtDecoderBuilder

public class XsuaaJwtDecoderBuilder extends Object
  • Constructor Details

    • XsuaaJwtDecoderBuilder

      public XsuaaJwtDecoderBuilder(XsuaaServiceConfiguration configuration)
      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

      public XsuaaJwtDecoderBuilder withDecoderCacheTime(int timeInSeconds)
      Decoders cache the signing keys. Overwrite the cache time (default: 900 seconds).
      Parameters:
      timeInSeconds - time to cache the signing keys
      Returns:
      this
    • withDecoderCacheSize

      public XsuaaJwtDecoderBuilder withDecoderCacheSize(int size)
      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 the RestOperations instance which is used by the JwtDecoder to perform HTTP requests. This does not effect the ReactiveJwtDecoder that is constructed with buildAsReactive()
      Parameters:
      restOperations - the RestOperations instance.
      Returns:
      the builder itself.
    • withoutXsuaaAudienceValidator

      public XsuaaJwtDecoderBuilder withoutXsuaaAudienceValidator()
      Disables the JWT XsuaaAudienceValidator which is enabled by default.
      Returns:
      the builder itself.