Class JWTMessageSignatureSecurityHandler
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
org.opensaml.security.messaging.impl.BaseTrustEngineSecurityHandler<SignedJWT>
net.shibboleth.oidc.security.impl.BaseJWTSignatureSecurityHandler
net.shibboleth.oidc.security.impl.JWTMessageSignatureSecurityHandler
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
A
MessageHandler that uses a TrustEngine to evaluate the signature of a signed JWT.
Note, if the JWT is not in a signed state an exception will be thrown i.e. JWTs must be signed by the time this handler executes.
Also, the JWT must also have claims, otherwise an exception is throw. This restriction could be lifted if it is feasible to check the signature of a JWT with a null payload - even if pointless?
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<MessageContext,SignedJWT> Function that looks up a signed JWT token from the given message context to validate.private final org.slf4j.LoggerLogger.private SignedJWTThe extracted signed JWT that is to be validated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voiddoInvoke(MessageContext messageContext) protected booleandoPreInvoke(MessageContext messageContext) voidsetJwtTokenLookupStrategy(Function<MessageContext, SignedJWT> strategy) Set the strategy used to look up asigned JWT token.Methods inherited from class net.shibboleth.oidc.security.impl.BaseJWTSignatureSecurityHandler
adapt, buildCriteriaSet, getOIDCPeerEntityContext, resolveTrustEngine, setClientInformationLookupStrategy, setProviderMetadataLookupStrategy, setRelyingPartyContextLookupStrategy, setSecurityParametersContextLookupStrategyMethods inherited from class org.opensaml.security.messaging.impl.BaseTrustEngineSecurityHandler
evaluate, evaluate, getTrustEngineMethods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, isPreInvokeCalled, setActivationConditionMethods 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 logLogger. -
jwtTokenLookupStrategy
Function that looks up a signed JWT token from the given message context to validate. -
signedJwt
The extracted signed JWT that is to be validated.
-
-
Constructor Details
-
JWTMessageSignatureSecurityHandler
public JWTMessageSignatureSecurityHandler()
-
-
Method Details
-
setJwtTokenLookupStrategy
Set the strategy used to look up asigned JWT token.- Parameters:
strategy- lookup strategy
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException - Overrides:
doPreInvokein classBaseJWTSignatureSecurityHandler- Throws:
MessageHandlerException
-
doInvoke
- Specified by:
doInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-