Class DefaultOIDCUserInfoConfiguration

All Implemented Interfaces:
AuthenticationProfileConfiguration, InterceptorAwareProfileConfiguration, OIDCProfileConfiguration, OIDCUserInfoConfiguration, OAuth2ClientAuthenticableClientProfileConfiguration, OAuth2ClientAuthenticableProfileConfiguration, OAuth2DPoPProofValidatingProfileConfiguration, OAuth2InterceptorAwareProfileConfiguration, OAuth2ProfileConfiguration, OAuth2TokenEncryptionProfileConfiguration, OAuth2TokenValidatingProfileConfiguration, AttributeResolvingProfileConfiguration, ConditionalProfileConfiguration, OverriddenIssuerProfileConfiguration, ProfileConfiguration, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent

public class DefaultOIDCUserInfoConfiguration extends AbstractOAuth2TokenValidatingConfiguration implements OIDCUserInfoConfiguration
Implementation of a profile configuration for the OpenID Connect core protocol userinfo endpoint.
  • Field Details

    • PROFILE_COUNTER

      @Nonnull @NotEmpty public static final String PROFILE_COUNTER
      OIDC UserInfo profile counter name.
      See Also:
    • resolveAttributesPredicate

      @Nonnull private Predicate<ProfileRequestContext> resolveAttributesPredicate
      Whether attributes should be resolved in the course of the profile.
    • encryptionOptionalPredicate

      @Nonnull private Predicate<ProfileRequestContext> encryptionOptionalPredicate
      Whether encryption is optional in the face of no key, etc.
    • deniedUserInfoAttributesLookupStrategy

      @Nonnull private Function<ProfileRequestContext,Set<String>> deniedUserInfoAttributesLookupStrategy
      Lookup function to supply attribute IDs to omit from UserInfo token.
  • Constructor Details

    • DefaultOIDCUserInfoConfiguration

      public DefaultOIDCUserInfoConfiguration()
      Constructor.
    • DefaultOIDCUserInfoConfiguration

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

    • isResolveAttributes

      public boolean isResolveAttributes(@Nullable ProfileRequestContext profileRequestContext)
      Specified by:
      isResolveAttributes in interface AttributeResolvingProfileConfiguration
    • setResolveAttributes

      public void setResolveAttributes(boolean flag)
      Set whether attributes should be resolved during the profile.
      Parameters:
      flag - flag to set
    • setResolveAttributesPredicate

      public void setResolveAttributesPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
      Set a condition to determine whether attributes should be resolved during the profile.
      Parameters:
      condition - condition to set
    • isEncryptionOptional

      public boolean isEncryptionOptional(@Nullable ProfileRequestContext profileRequestContext)
      Description copied from interface: OAuth2TokenEncryptionProfileConfiguration
      Get whether encryption is optional in the face of a missing key, etc.
      Specified by:
      isEncryptionOptional in interface OAuth2TokenEncryptionProfileConfiguration
      Parameters:
      profileRequestContext - current profile request context
      Returns:
      true iff encryption is optional
    • setEncryptionOptional

      public void setEncryptionOptional(boolean flag)
      Set whether encryption is optional in the face of a missing key, etc.
      Parameters:
      flag - flag to set
    • setEncryptionOptionalPredicate

      public void setEncryptionOptionalPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
      Set a condition to determine whether encryption is optional in the face of a missing key, etc.
      Parameters:
      condition - condition to set
    • getDeniedUserInfoAttributes

      @Nonnull @NonnullElements @NotLive public Set<String> getDeniedUserInfoAttributes(@Nullable ProfileRequestContext profileRequestContext)
      Description copied from interface: OIDCUserInfoConfiguration
      Get the set of attribute IDs which should be omitted from the UserInfo token.

      Default behavior is to include all claims, but omiited claims also affect the set that may need to be embedded for recovery into the access/refresh tokens.

      Specified by:
      getDeniedUserInfoAttributes in interface OIDCUserInfoConfiguration
      Parameters:
      profileRequestContext - profile request context
      Returns:
      the attribute IDs to omit from UserInfo token
    • setDeniedUserInfoAttributes

      public void setDeniedUserInfoAttributes(@Nullable @NonnullElements Collection<String> attributes)
      Set the set of attribute IDs which should be omitted from the UserInfo token.

      Default behavior is to include all claims, but omiited claims also affect the set that may need to be embedded for recovery into the access/refresh tokens.

      Parameters:
      attributes - the attribute IDs to omit from UserInfo token
    • setDeniedUserInfoAttributesLookupStrategy

      public void setDeniedUserInfoAttributesLookupStrategy(@Nonnull Function<ProfileRequestContext,Set<String>> strategy)
      Set a lookup strategy for the set of attribute IDs which should be omitted from the UserInfo token.
      Parameters:
      strategy - lookup strategy