Class AbstractAuthorizationRequestLookupFunction<T>

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.oidc.op.messaging.context.navigate.AbstractAuthorizationRequestLookupFunction<T>
Type Parameters:
T - type of lookup result to return.
All Implemented Interfaces:
Function<ProfileRequestContext,T>, Component, DestructableComponent, InitializableComponent, ContextDataLookupFunction<ProfileRequestContext,T>
Direct Known Subclasses:
AbstractAuthenticationRequestLookupFunction, DefaultRequestAudienceLookupFunction, DefaultRequestCodeChallengeLookupFunction, DefaultRequestCodeChallengeMethodLookupFunction, DefaultRequestDPoPJktLookupFunction, DefaultRequestedPromptLookupFunction, DefaultRequestedScopeLookupFunction, DefaultRequestRedirectURILookupFunction, DefaultRequestResponseModeLookupFunction, DefaultRequestResponseTypeLookupFunction, DefaultRequestStateLookupFunction, DefaultValidResponseTypesLookupFunction

@ThreadSafeAfterInit public abstract class AbstractAuthorizationRequestLookupFunction<T> extends AbstractInitializableComponent implements ContextDataLookupFunction<ProfileRequestContext,T>
An abstract function extended by lookups searching fields from authorization request.
Since:
4.2.0
  • Field Details

    • log

      @Nonnull private org.slf4j.Logger log
      Class logger.
    • messageClass

      @Nonnull private final Class<? extends AuthorizationRequest> messageClass
      The request message class to verify that the actual request is an instance of.
    • useOnlyRequestObjectPredicate

      @Nonnull private BiPredicate<Pair<AuthorizationRequest,Boolean>,String> useOnlyRequestObjectPredicate
      The predicate to decide if the parameter values may only be set in the request object.
  • Constructor Details

    • AbstractAuthorizationRequestLookupFunction

      public AbstractAuthorizationRequestLookupFunction()
      Constructor.
    • AbstractAuthorizationRequestLookupFunction

      protected AbstractAuthorizationRequestLookupFunction(@Nonnull Class<? extends AuthorizationRequest> clazz)
      Constructor.
      Parameters:
      clazz - request message class to verify that the actual request is an instance of.
  • Method Details

    • setUseOnlyRequestObjectPredicate

      public void setUseOnlyRequestObjectPredicate(@Nonnull BiPredicate<Pair<AuthorizationRequest,Boolean>,String> predicate)
      Set the predicate to decide if the parameter values may only be set in the request object.
      Parameters:
      predicate - the predicate to decide if the parameter values may only be set in the request object.
    • doLookup

      @Nullable protected abstract T doLookup(@Nonnull AuthorizationRequest authorizationRequest, @Nullable PushedAuthorizationRequest parRequest, @Nullable JWT requestObject, boolean isRequestObjectFromPar)
      Implemented to perform the actual lookup.
      Parameters:
      authorizationRequest - authorization request to perform the lookup from.
      parRequest - pushed authorization request if authorization request was pushed.
      requestObject - request object if it was part of the request.
      isRequestObjectFromPar - flag to indicate that the request object is built by the PAR endpoint.
      Returns:
      lookup value.
    • apply

      @Nullable public T apply(@Nullable ProfileRequestContext input)
      Specified by:
      apply in interface Function<ProfileRequestContext,T>
    • checkRequestObject

      @Nullable protected T checkRequestObject(@Nonnull AuthorizationRequest authorizationRequest, boolean isRequestObjectFromPar, @Nonnull String parameterName, @Nullable T parameterValue, @Nullable T defaultResult)
      Check if the given AuthorizationRequest and parameter should only be set in the request object. It's tested with useOnlyRequestObjectPredicate: if it returns true, the default result is returned instead of the parameter value.
      Parameters:
      authorizationRequest - the authorization request being processed.
      isRequestObjectFromPar - flag to indicate that the request object is produced by the PAR endpoint.
      parameterName - the parameter name.
      parameterValue - the value found from the parameters.
      defaultResult - the default value to be used if the request contained OAuth2 JAR request object.
      Returns:
      the parameter value to be used, depending on the authorization request message contents.