Package net.shibboleth.oidc.profile.impl
Class PopulateJWTSignatureSigningParametersHandler
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.handler.AbstractMessageHandler
-
- net.shibboleth.oidc.profile.impl.PopulateJWTSignatureSigningParametersHandler
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
public class PopulateJWTSignatureSigningParametersHandler extends AbstractMessageHandler
Handler that resolves and populatesSignatureSigningParameterson aSecurityParametersContextcreated/accessed via a lookup function, by default as an immediate child context of the targetMessageContext.Extracts any OpenID client/provider metadata, SAML metadata, and static client credentials from relying party configuration as criteria to pass to the signing parameters resolver.
- Since:
- 2.2.0
-
-
Field Summary
Fields Modifier and Type Field Description private Function<MessageContext,List<SignatureSigningConfiguration>>configurationLookupStrategyStrategy used to look up a per-requestSignatureSigningConfigurationlist.private Function<MessageContext,SecurityParametersContext>existingParametersContextLookupStrategyStrategy used to look up an existingSecurityParametersContextto copy.private org.slf4j.LoggerlogClass logger.private Function<MessageContext,SAMLMetadataContext>metadataContextLookupStrategyStrategy used to look up a SAML metadata context.private booleannoResultIsErrorWhether failure to resolve parameters should be raised as an error.private Function<MessageContext,OIDCMetadataContext>oidcClientMetadataContextLookupStrategyStrategy used to look up a OIDC client metadata context.private Function<MessageContext,OIDCProviderMetadataContext>oidcProviderMetadataContextLookupStrategyStrategy used to look up a OIDC provider metadata context.private Function<MessageContext,net.shibboleth.idp.profile.context.RelyingPartyContext>relyingPartyContextLookupStrategyLookup function for relying party context.private SignatureSigningParametersResolverresolverResolver for parameters to store into context.private Function<MessageContext,SecurityParametersContext>securityParametersContextLookupStrategyStrategy used to look up theSecurityParametersContextto set the parameters for.
-
Constructor Summary
Constructors Constructor Description PopulateJWTSignatureSigningParametersHandler()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()protected voiddoInvoke(MessageContext messageContext)protected booleandoPreInvoke(MessageContext messageContext)voidsetClientMetadataContextLookupStrategy(Function<MessageContext,OIDCMetadataContext> strategy)Set lookup strategy forOIDCMetadataContextfor input to resolution.voidsetConfigurationLookupStrategy(Function<MessageContext,List<SignatureSigningConfiguration>> strategy)Set the strategy used to look up a per-requestSignatureSigningConfigurationlist.voidsetExistingParametersContextLookupStrategy(Function<MessageContext,SecurityParametersContext> strategy)Set the strategy used to look up an existingSecurityParametersContextto copy instead of actually resolving the parameters to set.voidsetMetadataContextLookupStrategy(Function<MessageContext,SAMLMetadataContext> strategy)Set lookup strategy forSAMLMetadataContextfor input to resolution.voidsetNoResultIsError(boolean flag)Set whether a failure to resolve any parameters should be raised as an exception.voidsetProviderMetadataContextLookupStrategy(Function<MessageContext,OIDCProviderMetadataContext> strategy)Set lookup strategy forOIDCProviderMetadataContextfor input to resolution.voidsetRelyingPartyContextLookupStrategy(Function<MessageContext,net.shibboleth.idp.profile.context.RelyingPartyContext> strategy)Set lookup strategy for relying party context.voidsetSecurityParametersContextLookupStrategy(Function<MessageContext,SecurityParametersContext> strategy)Set the strategy used to look up theSecurityParametersContextto set the parameters for.voidsetSignatureSigningParametersResolver(SignatureSigningParametersResolver newResolver)Set the resolver to use for the parameters to store into the context.-
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
-
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 final org.slf4j.Logger log
Class logger.
-
securityParametersContextLookupStrategy
@Nonnull private Function<MessageContext,SecurityParametersContext> securityParametersContextLookupStrategy
Strategy used to look up theSecurityParametersContextto set the parameters for.
-
existingParametersContextLookupStrategy
@Nullable private Function<MessageContext,SecurityParametersContext> existingParametersContextLookupStrategy
Strategy used to look up an existingSecurityParametersContextto copy.
-
configurationLookupStrategy
@NonnullAfterInit private Function<MessageContext,List<SignatureSigningConfiguration>> configurationLookupStrategy
Strategy used to look up a per-requestSignatureSigningConfigurationlist.
-
metadataContextLookupStrategy
@Nonnull private Function<MessageContext,SAMLMetadataContext> metadataContextLookupStrategy
Strategy used to look up a SAML metadata context.
-
oidcClientMetadataContextLookupStrategy
@Nonnull private Function<MessageContext,OIDCMetadataContext> oidcClientMetadataContextLookupStrategy
Strategy used to look up a OIDC client metadata context.
-
oidcProviderMetadataContextLookupStrategy
@Nonnull private Function<MessageContext,OIDCProviderMetadataContext> oidcProviderMetadataContextLookupStrategy
Strategy used to look up a OIDC provider metadata context.
-
relyingPartyContextLookupStrategy
@Nonnull private Function<MessageContext,net.shibboleth.idp.profile.context.RelyingPartyContext> relyingPartyContextLookupStrategy
Lookup function for relying party context.
-
resolver
@NonnullAfterInit private SignatureSigningParametersResolver resolver
Resolver for parameters to store into context.
-
noResultIsError
private boolean noResultIsError
Whether failure to resolve parameters should be raised as an error.
-
-
Method Detail
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<MessageContext,net.shibboleth.idp.profile.context.RelyingPartyContext> strategy)Set lookup strategy for relying party context.- Parameters:
strategy- lookup strategy
-
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
-
setClientMetadataContextLookupStrategy
public void setClientMetadataContextLookupStrategy(@Nonnull Function<MessageContext,OIDCMetadataContext> strategy)Set lookup strategy forOIDCMetadataContextfor input to resolution.- Parameters:
strategy- lookup strategy
-
setProviderMetadataContextLookupStrategy
public void setProviderMetadataContextLookupStrategy(@Nonnull Function<MessageContext,OIDCProviderMetadataContext> strategy)Set lookup strategy forOIDCProviderMetadataContextfor input to resolution.- Parameters:
strategy- lookup strategy
-
setSignatureSigningParametersResolver
public void setSignatureSigningParametersResolver(@Nonnull SignatureSigningParametersResolver newResolver)Set the resolver to use for the parameters to store into the context.- Parameters:
newResolver- resolver to use
-
setExistingParametersContextLookupStrategy
public void setExistingParametersContextLookupStrategy(@Nullable Function<MessageContext,SecurityParametersContext> strategy)Set the strategy used to look up an existingSecurityParametersContextto copy instead of actually resolving the parameters to set.- Parameters:
strategy- lookup strategy
-
setMetadataContextLookupStrategy
public void setMetadataContextLookupStrategy(@Nonnull Function<MessageContext,SAMLMetadataContext> strategy)Set lookup strategy forSAMLMetadataContextfor input to resolution.- Parameters:
strategy- lookup strategy
-
setConfigurationLookupStrategy
public void setConfigurationLookupStrategy(@Nonnull Function<MessageContext,List<SignatureSigningConfiguration>> strategy)Set the strategy used to look up a per-requestSignatureSigningConfigurationlist.- Parameters:
strategy- lookup strategy
-
setNoResultIsError
public void setNoResultIsError(boolean flag)
Set whether a failure to resolve any parameters should be raised as an exception.Defaults to false.
- Parameters:
flag- flag to set
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException- Overrides:
doPreInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-
doInvoke
protected void doInvoke(MessageContext messageContext) throws MessageHandlerException
- Specified by:
doInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-
-