Class CheckClientJWTSignatureAlgorithmHandler
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
net.shibboleth.oidc.security.impl.CheckClientJWTSignatureAlgorithmHandler
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
A
MessageHandler that uses a OIDCClientInformation to verify the signature of a signed JWT uses
expected algorithm.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<MessageContext,OIDCClientInformation> Function that looks up client information from the given message context.private StringThe default algorithm value used if lookup strategy returned null.private Function<MessageContext,SignedJWT> Function that looks up a signed JWT token from the given message context to validate .private final org.slf4j.LoggerLogger.private Function<OIDCClientInformation,String> A lookup function for the signature algorithm in the client metadata.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) protected StringgetExpectedAlgorithm(OIDCClientInformation clientInformation) Fetches the expected signature algorithm from theOIDCClientInformation.voidSet the lookup strategy to locate the client information.voidsetDefaultAlgorithmValue(String value) Set the default algorithm value used if lookup strategy returned null.voidsetJwtTokenLookupStrategy(Function<MessageContext, SignedJWT> strategy) Set the strategy used to look up aSignedJWT.voidSet the strategy used to look up the signature algorithm in the client metadata.Methods 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 . -
clientInformationLookupStrategy
@NonnullAfterInit private Function<MessageContext,OIDCClientInformation> clientInformationLookupStrategyFunction that looks up client information from the given message context. Can return null if not used. -
signatureAlgorithmLookupStrategy
A lookup function for the signature algorithm in the client metadata. -
signedJwt
The extracted signed JWT that is to be validated. -
defaultAlgorithmValue
The default algorithm value used if lookup strategy returned null.
-
-
Constructor Details
-
CheckClientJWTSignatureAlgorithmHandler
public CheckClientJWTSignatureAlgorithmHandler()
-
-
Method Details
-
setJwtTokenLookupStrategy
Set the strategy used to look up aSignedJWT.- Parameters:
strategy- lookup strategy
-
setClientInformationLookupStrategy
public void setClientInformationLookupStrategy(@Nonnull Function<MessageContext, OIDCClientInformation> strategy) Set the lookup strategy to locate the client information.- Parameters:
strategy- the strategy.
-
setSignatureAlgorithmLookupStrategy
public void setSignatureAlgorithmLookupStrategy(@Nonnull Function<OIDCClientInformation, String> strategy) Set the strategy used to look up the signature algorithm in the client metadata.- Parameters:
strategy- lookup strategy
-
setDefaultAlgorithmValue
Set the default algorithm value used if lookup strategy returned null.- Parameters:
value- default value
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException - Overrides:
doPreInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-
doInvoke
- Specified by:
doInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-
getExpectedAlgorithm
Fetches the expected signature algorithm from theOIDCClientInformation.- Parameters:
clientInformation- the client information/metadata.- Returns:
- the expected algorithm value.
-