Class AbstractProcessTokenAction<T>
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<T>
net.shibboleth.idp.plugin.oidc.op.oauth2.profile.impl.AbstractProcessTokenAction<T>
- Type Parameters:
T- request message type
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
- Direct Known Subclasses:
ProcessTokenForIntrospection,ProcessTokenForRevocation
Action that processes a token by validating it and populating the resulting
JWTClaimsSet
into an OAuth2TokenMgmtResponseContext placed beneath the outbound MessageContext.
If the token can't be validated, the context is not populated.
- Since:
- 3.1.0
- Event:
EventIds.PROCEED_EVENT_ID,IdPEventIds.INVALID_PROFILE_CONFIG- Postcondition:
- If the token is valid for use, ProfileRequestContext.getOutboundMessageContext().getSubcontext(
OAuth2TokenMgmtResponseContext.class) != null and the context contains the token's
JWTClaimsSet.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClaimsValidatorThe claims validator to use.private Function<ProfileRequestContext,ClaimsValidator> Lookup strategy for claims validator.private CredentialResolverSource of signing keys.private DataSealerData sealer for unwrapping token.private org.slf4j.LoggerClass logger.List of deserializer bi-functions for refresh tokens to be used in addition to unsealing opaque value.private com.nimbusds.jwt.SignedJWTCopy of signed JWT for non-opaque access tokens. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) protected abstract com.nimbusds.oauth2.sdk.token.TokengetToken(ProfileRequestContext profileRequestContext) Get the token to process.protected com.nimbusds.jwt.JWTClaimsSetparseAccessToken(com.nimbusds.oauth2.sdk.token.Token token) Attempt to parse token.protected com.nimbusds.jwt.JWTClaimsSetparseRefreshToken(ProfileRequestContext profileRequestContext, com.nimbusds.oauth2.sdk.token.Token token) Attempt to parse refresh token.voidSet the claims validator lookup strategy.voidsetCredentialResolver(CredentialResolver resolver) Set the source of signing keys to use for JWT signature verification.voidsetDataSealer(DataSealer sealer) Set the data sealer instance to use.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.Methods 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 token. -
claimsValidatorLookupStrategy
Lookup strategy for claims validator. -
claimsValidator
The claims validator to use. -
credentialResolver
Source of signing keys. -
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. -
signedJWT
@Nullable private com.nimbusds.jwt.SignedJWT signedJWTCopy of signed JWT for non-opaque access tokens.
-
-
Constructor Details
-
AbstractProcessTokenAction
public AbstractProcessTokenAction()Constructor.
-
-
Method Details
-
setClaimsValidatorLookupStrategy
public void setClaimsValidatorLookupStrategy(@Nonnull Function<ProfileRequestContext, ClaimsValidator> strategy) Set the claims validator lookup strategy.- Parameters:
strategy- lookup strategy
-
setCredentialResolver
Set the source of signing keys to use for JWT signature verification.- Parameters:
resolver- signing key resolver
-
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 classAbstractOIDCRequestAction<T>
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
parseAccessToken
@Nullable protected com.nimbusds.jwt.JWTClaimsSet parseAccessToken(@Nonnull @NotEmpty com.nimbusds.oauth2.sdk.token.Token token) Attempt to parse token.- Parameters:
token- the token- Returns:
- parsed claim set or null
-
parseRefreshToken
@Nullable protected com.nimbusds.jwt.JWTClaimsSet parseRefreshToken(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty com.nimbusds.oauth2.sdk.token.Token token) Attempt to parse refresh token.- Parameters:
profileRequestContext- the profile request contexttoken- the token- Returns:
- parsed claim set or null
-
getToken
@Nullable protected abstract com.nimbusds.oauth2.sdk.token.Token getToken(@Nonnull ProfileRequestContext profileRequestContext) Get the token to process.- Parameters:
profileRequestContext- current profile request context- Returns:
- the token to process