Class RevokeToken
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.profile.action.AbstractConditionalProfileAction
-
- net.shibboleth.idp.profile.AbstractProfileAction
-
- net.shibboleth.idp.plugin.oidc.op.oauth2.profile.impl.RevokeToken
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class RevokeToken extends net.shibboleth.idp.profile.AbstractProfileActionAction that revokes a single token or the full chain of tokens, depending on the result of the configured lookup strategy for the revocation method. The full chain of tokens refer to the token that is fed to this action together with all other tokens related to the same root token identifier. For legacy reasons, if the root token identifier is not existing in the claims set but the full chain is to be revoked, the JWT identifier (jti) from the claims set is used as the root token identifier.- Event:
EventIds.PROCEED_EVENT_ID,OidcEventIds.REVOCATION_FAILED
-
-
Field Summary
Fields Modifier and Type Field Description private Function<ProfileRequestContext,Duration>chainRevocationLifetimeLookupStrategyLookup function to supply chain revocation lifetime.private com.nimbusds.jwt.JWTClaimsSetclaimsSetThe claims set to operate on.private org.slf4j.LoggerlogClass logger.private RevocationCacherevocationCacheMessage revocation cache instance to use.private DurationrevocationLifetimeRevocation lifetime to use.private net.shibboleth.oidc.profile.oauth2.config.OAuth2TokenRevocationConfiguration.OAuth2TokenRevocationMethodrevocationMethodRevocation method used when revoking a token.private Function<ProfileRequestContext,net.shibboleth.oidc.profile.oauth2.config.OAuth2TokenRevocationConfiguration.OAuth2TokenRevocationMethod>revocationMethodLookupStrategyWhich revocation method should be used when revoking a token.private Function<com.nimbusds.jwt.JWTClaimsSet,String>rootTokenIdentifierLookupStrategyLookup function to supply root token identifier.private Function<com.nimbusds.jwt.JWTClaimsSet,Duration>tokenRevocationLifetimeLookupStrategyLookup function to supply token revocation lifetime.
-
Constructor Summary
Constructors Constructor Description RevokeToken()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext)protected voiddoInitialize()protected booleandoPreExecute(ProfileRequestContext profileRequestContext)voidsetChainRevocationLifetimeLookupStrategy(Function<ProfileRequestContext,Duration> strategy)Set a lookup strategy for the chain revocation lifetime.voidsetRevocationCache(RevocationCache cache)Set the revocation cache instance to use.voidsetRevocationMethodLookupStrategy(Function<ProfileRequestContext,net.shibboleth.oidc.profile.oauth2.config.OAuth2TokenRevocationConfiguration.OAuth2TokenRevocationMethod> strategy)Set strategy for looking up which revocation method should be used when revoking a token.voidsetRootTokenIdentifierLookupStrategy(Function<com.nimbusds.jwt.JWTClaimsSet,String> strategy)Set a lookup strategy for the root token identifier.voidsetTokenRevocationLifetimeLookupStrategy(Function<com.nimbusds.jwt.JWTClaimsSet,Duration> strategy)Set a lookup strategy for the token revocation lifetime.-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
-
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private org.slf4j.Logger log
Class logger.
-
revocationCache
@NonnullAfterInit private RevocationCache revocationCache
Message revocation cache instance to use.
-
revocationMethodLookupStrategy
@Nonnull private Function<ProfileRequestContext,net.shibboleth.oidc.profile.oauth2.config.OAuth2TokenRevocationConfiguration.OAuth2TokenRevocationMethod> revocationMethodLookupStrategy
Which revocation method should be used when revoking a token. Supported values are CHAIN and TOKEN. The default is CHAIN.
-
chainRevocationLifetimeLookupStrategy
@Nonnull private Function<ProfileRequestContext,Duration> chainRevocationLifetimeLookupStrategy
Lookup function to supply chain revocation lifetime.
-
tokenRevocationLifetimeLookupStrategy
@Nonnull private Function<com.nimbusds.jwt.JWTClaimsSet,Duration> tokenRevocationLifetimeLookupStrategy
Lookup function to supply token revocation lifetime.
-
rootTokenIdentifierLookupStrategy
@Nonnull private Function<com.nimbusds.jwt.JWTClaimsSet,String> rootTokenIdentifierLookupStrategy
Lookup function to supply root token identifier.
-
revocationMethod
private net.shibboleth.oidc.profile.oauth2.config.OAuth2TokenRevocationConfiguration.OAuth2TokenRevocationMethod revocationMethod
Revocation method used when revoking a token.
-
revocationLifetime
private Duration revocationLifetime
Revocation lifetime to use.
-
claimsSet
private com.nimbusds.jwt.JWTClaimsSet claimsSet
The claims set to operate on.
-
-
Method Detail
-
setRevocationCache
public void setRevocationCache(@Nonnull RevocationCache cache)Set the revocation cache instance to use.- Parameters:
cache- The revocationCache to set.
-
setRevocationMethodLookupStrategy
public void setRevocationMethodLookupStrategy(@Nonnull Function<ProfileRequestContext,net.shibboleth.oidc.profile.oauth2.config.OAuth2TokenRevocationConfiguration.OAuth2TokenRevocationMethod> strategy)Set strategy for looking up which revocation method should be used when revoking a token.- Parameters:
strategy- What 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.
-
setTokenRevocationLifetimeLookupStrategy
public void setTokenRevocationLifetimeLookupStrategy(@Nullable Function<com.nimbusds.jwt.JWTClaimsSet,Duration> strategy)Set a lookup strategy for the token revocation lifetime.- Parameters:
strategy- What to set.
-
setRootTokenIdentifierLookupStrategy
public void setRootTokenIdentifierLookupStrategy(@Nullable Function<com.nimbusds.jwt.JWTClaimsSet,String> strategy)Set a lookup strategy for the root token identifier.- Parameters:
strategy- What to set.
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
-