Class DecryptJWE
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Decrypt the located JWE using the decryption parameters stored in the security context.
- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_SEC_CFG,OidcEventIds.INVALID_TOKEN- Postcondition:
- Decrypt a JWT and add it back to via an update strategy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JWETokenDecrypterThe decryption object.private EncryptedJWTThe extracted encrypted JWT that is to be validated.private StringEvent identifier to publish in the case of decryption errors.private Function<ProfileRequestContext,EncryptedJWT> Function that looks up a signed JWT token from the given message context to validate.private BiConsumer<ProfileRequestContext,JWT> A consumer that sets the JWT produced from this decryption operation back into the profile request context.private final org.slf4j.LoggerClass logger.Strategy used to locate theSecurityParametersContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) private voidLog (on trace) the JWT.voidSets the event identifier to publish in the case of decryption errors.voidSet the strategy used to look up aencrypted JWT token.voidsetJwtUpdateStrategy(BiConsumer<ProfileRequestContext, JWT> strategy) Set the strategy used to update the profile request context with the JWT produced as a result of this decryption operation.voidsetSecurityParametersContextLookupStrategy(Function<ProfileRequestContext, SecurityParametersContext> strategy) Set the strategy used to locate theSecurityParametersContextassociated with a givenProfileRequestContext.Methods 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 final org.slf4j.Logger logClass logger. -
jwtTokenLookupStrategy
Function that looks up a signed JWT token from the given message context to validate. -
jwtUpdateStrategy
A consumer that sets the JWT produced from this decryption operation back into the profile request context. -
errorEventId
Event identifier to publish in the case of decryption errors. -
encryptedJwt
The extracted encrypted JWT that is to be validated. -
decrypter
The decryption object. -
securityParamsLookupStrategy
@Nonnull private Function<ProfileRequestContext,SecurityParametersContext> securityParamsLookupStrategyStrategy used to locate theSecurityParametersContext.
-
-
Constructor Details
-
DecryptJWE
public DecryptJWE()Constructor.
-
-
Method Details
-
setSecurityParametersContextLookupStrategy
public void setSecurityParametersContextLookupStrategy(@Nonnull Function<ProfileRequestContext, SecurityParametersContext> strategy) Set the strategy used to locate theSecurityParametersContextassociated with a givenProfileRequestContext.- Parameters:
strategy- strategy used to locate theSecurityParametersContextassociated with a givenProfileRequestContext
-
setJwtUpdateStrategy
Set the strategy used to update the profile request context with the JWT produced as a result of this decryption operation.- Parameters:
strategy- the strategy
-
setJwtTokenLookupStrategy
public void setJwtTokenLookupStrategy(@Nonnull Function<ProfileRequestContext, EncryptedJWT> strategy) Set the strategy used to look up aencrypted JWT token.- Parameters:
strategy- lookup strategy
-
setErrorEventId
Sets the event identifier to publish in the case of decryption errors.- Parameters:
id- the identifier to set
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
logJWT
Log (on trace) the JWT.- Parameters:
jwt- the JWT to log.
-