Class BaseJWTSignatureSecurityHandler
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
org.opensaml.security.messaging.impl.BaseTrustEngineSecurityHandler<com.nimbusds.jwt.SignedJWT>
net.shibboleth.oidc.security.impl.BaseJWTSignatureSecurityHandler
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
- Direct Known Subclasses:
JWTMessageSignatureSecurityHandler
public abstract class BaseJWTSignatureSecurityHandler
extends BaseTrustEngineSecurityHandler<com.nimbusds.jwt.SignedJWT>
Base class for security message handlers which evaluate a JWT signature with a signature trust engine.
Criterion are constructed from the following sources:
- (Optional) Provider metadata.
- (Optional) Client information.
- (Optional) Client secret credentials.
- (Required) The SecurityParametersContext.
- Since:
- 2.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.nimbusds.openid.connect.sdk.rp.OIDCClientInformationThe client information found from the lookup strategy.private Function<MessageContext,com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation> Function that looks up client information from the given message context.private final org.slf4j.LoggerClass logger.private OIDCPeerEntityContextThe context representing the OIDC peer entity.private static final ParentProfileRequestContextLookup<MessageContext>Lookup function for parent ProfileRequestContext.Applicable stashed profile configuration appropriate for OAuth clients.private com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadataThe provider metadata found from the lookup strategy.private Function<MessageContext,com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata> Function that looks up provider metadata from the given message context.Lookup function for relying party context.Strategy used to look up theSecurityParametersContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> Function<MessageContext,T> adapt(Function<ProfileRequestContext, T> function) Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function.protected CriteriaSetbuildCriteriaSet(String entityID, MessageContext messageContext) protected booleandoPreInvoke(MessageContext messageContext) protected OIDCPeerEntityContextGet theOIDCPeerEntityContextassociated with the message.protected TrustEngine<com.nimbusds.jwt.SignedJWT>resolveTrustEngine(MessageContext messageContext) voidsetClientInformationLookupStrategy(Function<MessageContext, com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation> strategy) Set the lookup strategy to locate the client information.voidsetProviderMetadataLookupStrategy(Function<MessageContext, com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata> strategy) Set the lookup strategy to locate the OpenID providers metadata.voidSet lookup strategy for relying party context.voidsetSecurityParametersContextLookupStrategy(Function<MessageContext, SecurityParametersContext> strategy) Set the strategy used to look up theSecurityParametersContextto set the parameters for.Methods inherited from class org.opensaml.security.messaging.impl.BaseTrustEngineSecurityHandler
evaluate, evaluate, getTrustEngineMethods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doInvoke, doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, isPreInvokeCalled, setActivationConditionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, 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
-
PRC_LOOKUP
Lookup function for parent ProfileRequestContext. -
log
@Nonnull private final org.slf4j.Logger logClass logger. -
providerMetadataLookupStrategy
@Nonnull private Function<MessageContext,com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata> providerMetadataLookupStrategyFunction that looks up provider metadata from the given message context. Can return null if not used. -
clientInformationLookupStrategy
@Nonnull private Function<MessageContext,com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation> clientInformationLookupStrategyFunction that looks up client information from the given message context. Can return null if not used. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyLookup function for relying party context. -
securityParametersContextLookupStrategy
@Nonnull private Function<MessageContext,SecurityParametersContext> securityParametersContextLookupStrategyStrategy used to look up theSecurityParametersContext. -
profileConfiguration
Applicable stashed profile configuration appropriate for OAuth clients. -
peerContext
The context representing the OIDC peer entity. -
providerMetadata
@Nullable private com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata providerMetadataThe provider metadata found from the lookup strategy. -
clientInformation
@Nullable private com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation clientInformationThe client information found from the lookup strategy.
-
-
Constructor Details
-
BaseJWTSignatureSecurityHandler
protected BaseJWTSignatureSecurityHandler()Constructor.
-
-
Method Details
-
setSecurityParametersContextLookupStrategy
public void setSecurityParametersContextLookupStrategy(@Nonnull Function<MessageContext, SecurityParametersContext> strategy) Set the strategy used to look up theSecurityParametersContextto set the parameters for.- Parameters:
strategy- lookup strategy
-
setProviderMetadataLookupStrategy
public void setProviderMetadataLookupStrategy(@Nonnull Function<MessageContext, com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata> strategy) Set the lookup strategy to locate the OpenID providers metadata.- Parameters:
strategy- the strategy.
-
setClientInformationLookupStrategy
public void setClientInformationLookupStrategy(@Nonnull Function<MessageContext, com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation> strategy) Set the lookup strategy to locate the client information.- Parameters:
strategy- the strategy.
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext, RelyingPartyContext> strategy) Set lookup strategy for relying party context.- Parameters:
strategy- lookup strategy
-
getOIDCPeerEntityContext
Get theOIDCPeerEntityContextassociated with the message.- Returns:
- the peer context
-
resolveTrustEngine
@Nullable protected TrustEngine<com.nimbusds.jwt.SignedJWT> resolveTrustEngine(@Nonnull MessageContext messageContext) - Specified by:
resolveTrustEnginein classBaseTrustEngineSecurityHandler<com.nimbusds.jwt.SignedJWT>
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException - Overrides:
doPreInvokein classBaseTrustEngineSecurityHandler<com.nimbusds.jwt.SignedJWT>- Throws:
MessageHandlerException
-
buildCriteriaSet
protected CriteriaSet buildCriteriaSet(@Nullable String entityID, @Nonnull MessageContext messageContext) throws MessageHandlerException - Specified by:
buildCriteriaSetin classBaseTrustEngineSecurityHandler<com.nimbusds.jwt.SignedJWT>- Throws:
MessageHandlerException
-
adapt
@Nonnull protected <T> Function<MessageContext,T> adapt(@Nonnull Function<ProfileRequestContext, T> function) Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function.- Type Parameters:
T- the output type of the functions- Parameters:
function- the profile request context function- Returns:
- the message context function
-