Class DefaultOAuth2TokenConfiguration

All Implemented Interfaces:
AuthenticationProfileConfiguration, InterceptorAwareProfileConfiguration, OIDCFlowAwareProfileConfiguration, OIDCIDTokenProducingProfileConfiguration, OIDCProfileConfiguration, OIDCSSOProfileConfiguration, OIDCSSOProviderConfiguration, OIDCSSORelyingPartyConfiguration, OIDCSSORelyingPartyConfigurationEx, OAuth2AccessTokenProducingProfileConfiguration, OAuth2ClientAuthenticableClientProfileConfiguration, OAuth2ClientAuthenticableProfileConfiguration, OAuth2DPoPProofValidatingProfileConfiguration, OAuth2FlowAwareProfileConfiguration, OAuth2InterceptorAwareProfileConfiguration, OAuth2ProfileConfiguration, OAuth2RefreshTokenProducingProfileConfiguration, OAuth2ResourceIndicatingProfileConfiguration, OAuth2ScopeValidatingProfileConfiguration, OAuth2TokenConfiguration, OAuth2TokenEncryptionProfileConfiguration, AttributeResolvingProfileConfiguration, ConditionalProfileConfiguration, OverriddenIssuerProfileConfiguration, ProfileConfiguration, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent

public class DefaultOAuth2TokenConfiguration extends AbstractOIDCSSOConfiguration implements OAuth2TokenConfiguration
Implementation of an OIDC-aware OAuth 2 token endpoint profile configuration.
  • Field Details

  • Constructor Details

    • DefaultOAuth2TokenConfiguration

      public DefaultOAuth2TokenConfiguration()
      Constructor.
    • DefaultOAuth2TokenConfiguration

      public DefaultOAuth2TokenConfiguration(@Nonnull @NotEmpty String profileId)
      Creates a new configuration instance.
      Parameters:
      profileId - unique profile identifier
  • Method Details

    • getGrantTypes

      @Nonnull @NonnullElements @NotLive @Unmodifiable public Set<String> getGrantTypes(@Nullable ProfileRequestContext profileRequestContext)
      Description copied from interface: OAuth2TokenConfiguration
      Get the enabled grant types.
      Specified by:
      getGrantTypes in interface OAuth2TokenConfiguration
      Parameters:
      profileRequestContext - profile request context
      Returns:
      enabled grant types
    • setGrantTypes

      public void setGrantTypes(@Nonnull @NonnullElements Collection<String> types)
      Set the enabled grant types.
      Parameters:
      types - types to enable
    • setGrantTypesLookupStrategy

      public void setGrantTypesLookupStrategy(@Nonnull Function<ProfileRequestContext,Set<String>> strategy)
      Set a lookup strategy for the enabled grant types.
      Parameters:
      strategy - lookup strategy
    • getRefreshTokenClaimsSetManipulationStrategy

      @Nullable public BiFunction<ProfileRequestContext,Map<String,Object>,Map<String,Object>> getRefreshTokenClaimsSetManipulationStrategy(@Nullable ProfileRequestContext profileRequestContext)
      Get the bi-function for manipulating refresh token claims set.
      Specified by:
      getRefreshTokenClaimsSetManipulationStrategy in interface OAuth2TokenConfiguration
      Parameters:
      profileRequestContext - profile request context
      Returns:
      the bi-function for manipulating refresh token claims set
    • setRefreshTokenClaimsSetManipulationStrategy

      public void setRefreshTokenClaimsSetManipulationStrategy(@Nullable BiFunction<ProfileRequestContext,Map<String,Object>,Map<String,Object>> strategy)
      Set the bi-function for manipulating refresh token claims set.
      Parameters:
      strategy - bi-function for manipulating refresh token claims set
      Since:
      2.1.0
    • setRefreshTokenClaimsSetManipulationStrategyLookupStrategy

      public void setRefreshTokenClaimsSetManipulationStrategyLookupStrategy(@Nonnull Function<ProfileRequestContext,BiFunction<ProfileRequestContext,Map<String,Object>,Map<String,Object>>> strategy)
      Set a lookup strategy for the bi-function for manipulating refresh token claims set.
      Parameters:
      strategy - lookup strategy
      Since:
      2.1.0
    • isEnforceRefreshTokenRotation

      public boolean isEnforceRefreshTokenRotation(@Nullable ProfileRequestContext profileRequestContext)
      Get whether always revoke the refresh_token after it's used.
      Specified by:
      isEnforceRefreshTokenRotation in interface OAuth2TokenConfiguration
      Parameters:
      profileRequestContext - profile request context
      Returns:
      whether always revoke the refresh_token after it's used
    • setEnforceRefreshTokenRotation

      public void setEnforceRefreshTokenRotation(boolean flag)
      Set whether always revoke the refresh_token after it's used.
      Parameters:
      flag - flag to set
      Since:
      2.1.0
    • setEnforceRefreshTokenRotationPredicate

      public void setEnforceRefreshTokenRotationPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
      Set condition for whether always revoke the refresh_token after it's used.
      Parameters:
      condition - condition to set
      Since:
      2.1.0
    • isIssueIdTokenViaRefreshToken

      public boolean isIssueIdTokenViaRefreshToken(@Nullable ProfileRequestContext profileRequestContext)
      Get whether the id_token is issued when refresh token grant is used.
      Specified by:
      isIssueIdTokenViaRefreshToken in interface OAuth2TokenConfiguration
      Parameters:
      profileRequestContext - profile request context
      Returns:
      whether id_token is issued when refresh token grant is used
    • setIssueIdTokenViaRefreshToken

      public void setIssueIdTokenViaRefreshToken(boolean flag)
      Set whether the id_token is issued when refresh token grant is used.
      Parameters:
      flag - flag to set
      Since:
      2.2.0
    • setIssueIdTokenViaRefreshTokenPredicate

      public void setIssueIdTokenViaRefreshTokenPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
      Set condition for whether the id_token is issued when refresh token grant is used.
      Parameters:
      condition - condition to set
      Since:
      2.2.0
    • isLimitInitialAccessTokenToSelf

      public boolean isLimitInitialAccessTokenToSelf(@Nullable ProfileRequestContext profileRequestContext)
      Get whether the initial access token audience is solely to self (i.e. UserInfo) use.
      Specified by:
      isLimitInitialAccessTokenToSelf in interface OAuth2TokenConfiguration
      Parameters:
      profileRequestContext - profile request context
      Returns:
      whether initial access token audience is solely to self (i.e. UserInfo) use
    • setLimitInitialAccessTokenToSelf

      public void setLimitInitialAccessTokenToSelf(boolean flag)
      Set whether the initial access token audience is solely to self (i.e. UserInfo) use.
      Parameters:
      flag - flag to set
      Since:
      3.2.0
    • setLimitInitialAccessTokenToSelfPredicate

      public void setLimitInitialAccessTokenToSelfPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
      Set condition for whether initial access token audience is solely to self (i.e. UserInfo) use.
      Parameters:
      condition - condition to set
      Since:
      3.2.0
    • getResourceIndicators

      @Nonnull public List<String> getResourceIndicators(@Nullable ProfileRequestContext profileRequestContext)
      Get the set of OAuth 2.0 resource indicators associated with the given profile request context that specify the intended audiences of an OAuth 2.0 access token.

      TODO: Default implementation should be removed in 4.0.0

      Specified by:
      getResourceIndicators in interface OAuth2ResourceIndicatingProfileConfiguration
      Parameters:
      profileRequestContext - the profile request context
      Returns:
      the set of resource indicators.
    • setResourceIndicatorsLookupStrategy

      public void setResourceIndicatorsLookupStrategy(@Nonnull Function<ProfileRequestContext,List<String>> strategy)
      Set the lookup strategy used to find the set of OAuth 2.0 resource indicators associated with the given profile request context that specify the intended audiences for an OAuth 2.0 access token.
      Parameters:
      strategy - the strategy to set.
      Since:
      3.4.0
    • setResourceIndicators

      public void setResourceIndicators(@Nullable @NonnullElements List<String> resourceIndicators)
      Set the set of OAuth 2.0 resource indicators that specify the intended audiences for an OAuth 2.0 access token.
      Parameters:
      resourceIndicators - the set of resource indicators.
      Since:
      3.4.0