Class ValidateGrant
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.plugin.oidc.op.profile.impl.AbstractOIDCRequestAction<com.nimbusds.oauth2.sdk.TokenRequest>
net.shibboleth.idp.plugin.oidc.op.profile.impl.AbstractOIDCTokenRequestAction
net.shibboleth.idp.plugin.oidc.op.profile.impl.AbstractOIDCTokenResponseAction
net.shibboleth.idp.plugin.oidc.op.profile.impl.ValidateGrant
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Action that validates an authorization grant.
A grant is valid if it is successfully unwrapped, parsed as a code or refresh token, is unexpired, was issued to the expected client and has not been used before (authz code) or the authz code used to produce it has not been revoked (refresh token).
The validated claims from the grant are stored to response context via
OIDCAuthenticationResponseContext.getAuthorizationGrantClaimsSet().
Note that the addition of support for the "client_credentials" grant type means that there may not in fact be a grant, or resulting claims set.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,Duration> Lookup function to supply chain revocation lifetime.private final DataSealerData sealer for unwrapping authorization code.private org.slf4j.LoggerClass logger.private DurationRefresh Token lifetime.private Function<ProfileRequestContext,Duration> Strategy used to obtain the refresh token lifetime.List of deserializer bi-functions for refresh tokens to be used in addition to unsealing opaque value.private Predicate<ProfileRequestContext>Predicate used to indicate whether refresh tokens are enabled.Strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.private ReplayCacheMessage replay cache instance to use.private RevocationCacheMessage revocation cache instance to use.private RelyingPartyContextThe RelyingPartyContext to operate on. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RefreshTokenClaimsSetdeserializeRefreshToken(ProfileRequestContext profileRequestContext, String refreshToken) Attempt to deseriaalize a (serialized) refresh token value via configured deserializers.protected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) protected booleanrevokeChain(String id, Duration lifetime) Revokes the token chain with the given id, optionally with a given lifetime.voidSet a lookup strategy for the chain revocation lifetime.voidSet the strategy used to obtain the refresh token chain lifetime.voidsetRefreshTokenDeserializers(List<BiFunction<ProfileRequestContext, String, RefreshTokenClaimsSet>> deserializers) Set the list of deserializer bi-functions for refresh tokens to be used in addition to unsealing opaque value.voidSet the predicate used to indicate whether refresh tokens are enabled.voidSet the strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.voidsetReplayCache(ReplayCache cache) Set the replay cache instance to use.voidSet the revocation cache instance to use.Methods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.impl.AbstractOIDCTokenResponseAction
getMetadataContext, getOidcResponseContextMethods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.impl.AbstractOIDCTokenRequestAction
getTokenRequestMethods 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, 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. -
dataSealer
Data sealer for unwrapping authorization code. -
replayCache
Message replay cache instance to use. -
revocationCache
Message revocation cache instance to use. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyStrategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext. -
refreshTokensEnabledPredicate
Predicate used to indicate whether refresh tokens are enabled. -
chainRevocationLifetimeLookupStrategy
Lookup function to supply chain revocation lifetime. -
refreshTokenChainLifetimeLookupStrategy
Strategy used to obtain the refresh token lifetime. -
refreshTokenDeserializers
@Nonnull private List<BiFunction<ProfileRequestContext,String, refreshTokenDeserializersRefreshTokenClaimsSet>> List of deserializer bi-functions for refresh tokens to be used in addition to unsealing opaque value. -
rpCtx
The RelyingPartyContext to operate on. -
refreshTokenChainLifetime
Refresh Token lifetime.
-
-
Constructor Details
-
Method Details
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext, RelyingPartyContext> strategy) Set the strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.- Parameters:
strategy- strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext
-
setRefreshTokensEnabledPredicate
Set the predicate used to indicate whether refresh tokens are enabled.- Parameters:
predicate- predicate used to indicate whether refresh tokens are enabled.
-
setReplayCache
Set the replay cache instance to use.- Parameters:
cache- The replayCache to set.
-
setRevocationCache
Set the revocation cache instance to use.- Parameters:
cache- The revocationCache to set.
-
setChainRevocationLifetimeLookupStrategy
public void setChainRevocationLifetimeLookupStrategy(@Nullable Function<ProfileRequestContext, Duration> strategy) Set a lookup strategy for the chain revocation lifetime.- Parameters:
strategy- What to set.
-
setRefreshTokenChainLifetimeLookupStrategy
public void setRefreshTokenChainLifetimeLookupStrategy(@Nonnull Function<ProfileRequestContext, Duration> strategy) Set the strategy used to obtain the refresh token chain lifetime.- Parameters:
strategy- lookup strategy
-
setRefreshTokenDeserializers
public void setRefreshTokenDeserializers(@Nonnull List<BiFunction<ProfileRequestContext, String, RefreshTokenClaimsSet>> deserializers) Set the list of deserializer bi-functions for refresh tokens to be used in addition to unsealing opaque value.- Parameters:
deserializers- list of deserializers
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractOIDCTokenResponseAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
deserializeRefreshToken
protected RefreshTokenClaimsSet deserializeRefreshToken(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull String refreshToken) Attempt to deseriaalize a (serialized) refresh token value via configured deserializers.- Parameters:
profileRequestContext- The profile request context given to the deserializersrefreshToken- The serialized refresh token value- Returns:
- refresh token claims set, or null if it couldn't be parsed
-
revokeChain
Revokes the token chain with the given id, optionally with a given lifetime. If the given lifetime is null, the default lifetime set to theRevocationCacheis used.- Parameters:
id- The identifier to be revoked inRevocationCacheContexts.AUTHORIZATION_CODEcontext.lifetime- The lifetime for the revocation- Returns:
- The result returned by the
RevocationCache
-