All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, org.springframework.beans.factory.Aware, org.springframework.context.MessageSource, org.springframework.context.MessageSourceAware, org.springframework.webflow.execution.Action

public class ValidateAudience extends AbstractOIDCAuthenticationResponseAction
Action that validates requested resource/audience values against a computed set of "allowed" values and populates the resulting set into the OIDCAuthenticationResponseContext and a ProxiedRequesterContext.

This is an ordered list, so the first allowed value determines the "primary" audience of the eventual token.

Requesting values is optional. If the OP is an implied audience, then no other audience will be established, but if not then at least one audience must be permitted and the first permitted value will be assumed.

Event:
EventIds.PROCEED_EVENT_ID, EventIds.INVALID_PROFILE_CTX, OidcEventIds.INVALID_TARGET
  • Field Details

  • Constructor Details

    • ValidateAudience

      public ValidateAudience()
      Constructor.
  • Method Details

    • setRelyingPartyIdLookupStrategy

      public void setRelyingPartyIdLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
      Set the strategy used to obtain the relying party ID.
      Parameters:
      strategy - lookup strategy
    • setRequestedAudienceLookupStrategy

      public void setRequestedAudienceLookupStrategy(@Nullable Function<ProfileRequestContext,List<String>> strategy)
      Set the strategy used to locate the requested audience to validate.
      Parameters:
      strategy - lookup strategy
    • setAllowedAudienceLookupStrategy

      public void setAllowedAudienceLookupStrategy(@Nonnull Function<ProfileRequestContext,List<String>> strategy)
      Set the strategy used to locate the allowed audience for the client.
      Parameters:
      strategy - lookup strategy
    • setProxiedRequesterContextCreationStrategy

      public void setProxiedRequesterContextCreationStrategy(@Nonnull Function<ProfileRequestContext,ProxiedRequesterContext> strategy)
      Set the strategy used to locate or create the ProxiedRequesterContext.
      Parameters:
      strategy - lookup/creation strategy
    • setSelfAudienceCondition

      public void setSelfAudienceCondition(@Nonnull Predicate<ProfileRequestContext> condition)
      Set whether the OP is an implied audience for the token request.
      Parameters:
      condition - condition to set
      Since:
      3.2.0
    • setEnforceSelfAudienceCondition

      public void setEnforceSelfAudienceCondition(@Nonnull Predicate<ProfileRequestContext> condition)
      Set whether to enforce solely the OP as audience.
      Parameters:
      condition - condition to set
      Since:
      4.2.0
    • doExecute

      protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)
      Overrides:
      doExecute in class AbstractProfileAction