Class ValidateScope
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Requested scopes come from the inbound message and are possible but optional for both authorization and token requests. They come from lookup functions aware of each message type. If the request contains 'openid' scope but it's not allowed for this request, an error event published.
Previously granted scopes are stored in the response context's slot for previous authorization grant claims. In the case where no scopes are explicitly requested, we still filter the previous grants against the metadata.
Explicitly requested scopes are also filtered against, and override, any scopes previously validated as part of an authorization grant claim set. If this occurs, any grant-borne claims are removed because the association to specific scopes is gone by this point.
The "offline_access" scope is ignored and stripped for the authentication endpoint unless the response type includes "code".
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.Scope> Strategy used to obtain the scope allowed for the client.private org.slf4j.LoggerClass logger.private Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.Scope> Strategy used to obtain the mandatory scope value value.private Function<ProfileRequestContext,String> Strategy used to obtain the relying party ID.private Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.Scope> Strategy used to obtain the requested scope value.Strategy used to locate theOIDCAuthenticationResponseTokenClaimsContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) voidsetAllowedScopeLookupStrategy(Function<ProfileRequestContext, com.nimbusds.oauth2.sdk.Scope> strategy) Set the strategy used to locate the allowed scope for the client.voidsetMandatoryScopeLookupStrategy(Function<ProfileRequestContext, com.nimbusds.oauth2.sdk.Scope> strategy) Set the strategy used to locate the mandatory scope value.voidsetOIDCAuthenticationResponseTokenClaimsContextLookupStrategy(Function<ProfileRequestContext, OIDCAuthenticationResponseTokenClaimsContext> strategy) Set the strategy used to locate theOIDCAuthenticationResponseTokenClaimsContextassociated with a givenProfileRequestContext.voidSet the strategy used to obtain the relying party ID.voidsetRequestedScopeLookupStrategy(Function<ProfileRequestContext, com.nimbusds.oauth2.sdk.Scope> strategy) Set the strategy used to locate the requested scope to validate.Methods inherited from class net.shibboleth.idp.plugin.oidc.op.oauth2.profile.impl.AbstractOAuthAuthorizationResponseAction
doPreExecute, getMetadataContext, getOidcResponseContextMethods inherited from class net.shibboleth.idp.plugin.oidc.op.oauth2.profile.impl.AbstractOAuthAuthorizationRequestAction
getAuthorizationRequestMethods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.impl.AbstractOIDCRequestAction
getRequestMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
relyingPartyIdLookupStrategy
Strategy used to obtain the relying party ID. -
requestedScopeLookupStrategy
@Nullable private Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.Scope> requestedScopeLookupStrategyStrategy used to obtain the requested scope value. -
allowedScopeLookupStrategy
@Nonnull private Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.Scope> allowedScopeLookupStrategyStrategy used to obtain the scope allowed for the client. -
mandatoryScopeLookupStrategy
@Nonnull private Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.Scope> mandatoryScopeLookupStrategyStrategy used to obtain the mandatory scope value value. -
tokenClaimsContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,OIDCAuthenticationResponseTokenClaimsContext> tokenClaimsContextLookupStrategyStrategy used to locate theOIDCAuthenticationResponseTokenClaimsContext.
-
-
Constructor Details
-
ValidateScope
public ValidateScope()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
-
setRequestedScopeLookupStrategy
public void setRequestedScopeLookupStrategy(@Nullable Function<ProfileRequestContext, com.nimbusds.oauth2.sdk.Scope> strategy) Set the strategy used to locate the requested scope to validate.- Parameters:
strategy- lookup strategy
-
setAllowedScopeLookupStrategy
public void setAllowedScopeLookupStrategy(@Nonnull Function<ProfileRequestContext, com.nimbusds.oauth2.sdk.Scope> strategy) Set the strategy used to locate the allowed scope for the client.- Parameters:
strategy- lookup strategy
-
setMandatoryScopeLookupStrategy
public void setMandatoryScopeLookupStrategy(@Nonnull Function<ProfileRequestContext, com.nimbusds.oauth2.sdk.Scope> strategy) Set the strategy used to locate the mandatory scope value.- Parameters:
strategy- lookup strategy
-
setOIDCAuthenticationResponseTokenClaimsContextLookupStrategy
public void setOIDCAuthenticationResponseTokenClaimsContextLookupStrategy(@Nonnull Function<ProfileRequestContext, OIDCAuthenticationResponseTokenClaimsContext> strategy) Set the strategy used to locate theOIDCAuthenticationResponseTokenClaimsContextassociated with a givenProfileRequestContext.- Parameters:
strategy- lookup strategy
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-