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 Summary
FieldsModifier and TypeFieldDescriptionprivate org.slf4j.LoggerClass logger.private final Class<? extends com.nimbusds.oauth2.sdk.AuthorizationRequest>The request message class to verify that the actual request is an instance of.private BiPredicate<Pair<com.nimbusds.oauth2.sdk.AuthorizationRequest,Boolean>, String> The predicate to decide if the parameter values may only be set in the request object. -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructor.protectedAbstractAuthorizationRequestLookupFunction(Class<? extends com.nimbusds.oauth2.sdk.AuthorizationRequest> clazz) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionapply(ProfileRequestContext input) protected TcheckRequestObject(com.nimbusds.oauth2.sdk.AuthorizationRequest authorizationRequest, boolean isRequestObjectFromPar, String parameterName, T parameterValue, T defaultResult) Check if the givenAuthorizationRequestand parameter should only be set in the request object.protected abstract TdoLookup(com.nimbusds.oauth2.sdk.AuthorizationRequest authorizationRequest, com.nimbusds.oauth2.sdk.PushedAuthorizationRequest parRequest, com.nimbusds.jwt.JWT requestObject, boolean isRequestObjectFromPar) Implemented to perform the actual lookup.voidsetUseOnlyRequestObjectPredicate(BiPredicate<Pair<com.nimbusds.oauth2.sdk.AuthorizationRequest, Boolean>, String> predicate) Set the predicate to decide if the parameter values may only be set in the request object.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
messageClass
The request message class to verify that the actual request is an instance of. -
useOnlyRequestObjectPredicate
@Nonnull private BiPredicate<Pair<com.nimbusds.oauth2.sdk.AuthorizationRequest,Boolean>, useOnlyRequestObjectPredicateString> 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 com.nimbusds.oauth2.sdk.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<com.nimbusds.oauth2.sdk.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 com.nimbusds.oauth2.sdk.AuthorizationRequest authorizationRequest, @Nullable com.nimbusds.oauth2.sdk.PushedAuthorizationRequest parRequest, @Nullable com.nimbusds.jwt.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
- Specified by:
applyin interfaceFunction<ProfileRequestContext,T>
-
checkRequestObject
@Nullable protected T checkRequestObject(@Nonnull com.nimbusds.oauth2.sdk.AuthorizationRequest authorizationRequest, boolean isRequestObjectFromPar, @Nonnull String parameterName, @Nullable T parameterValue, @Nullable T defaultResult) Check if the givenAuthorizationRequestand parameter should only be set in the request object. It's tested withuseOnlyRequestObjectPredicate: 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.
-