Class OIDCProviderMetadataLookupHandler
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.handler.AbstractMessageHandler
-
- net.shibboleth.idp.plugin.authn.oidc.rp.metadata.impl.OIDCProviderMetadataLookupHandler
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
public class OIDCProviderMetadataLookupHandler extends AbstractMessageHandler
Handler for inbound OIDC protocol messages that attempts to locate OIDC metadata for a OP (issuer), and attaches it with aOIDCMetadataContextas a child of a pre-existing instance ofMessageContext.If the optional copy strategy is configured via
setCopyContextStrategy(Function), and if that lookup finds an existing metadata context with compatible data (matching the IssuerID), then its data will be re-used.
-
-
Field Summary
Fields Modifier and Type Field Description private Function<MessageContext,? extends AbstractOIDCEntityContext>contextClassLookupStrategyStrategy to resolve the context class to add the resolved metadata too.private Function<MessageContext,OIDCProviderMetadataContext>copyContextStrategyOptional strategy for resolving an existing metadata context from which to copy data.private org.slf4j.LoggerlogLogger.private ProviderMetadataResolverproviderResolverResolver used to look up OIDC provider information.
-
Constructor Summary
Constructors Constructor Description OIDCProviderMetadataLookupHandler()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()protected voiddoInvoke(MessageContext messageContext)protected OIDCProviderMetadataContextresolveExisting(MessageContext messageContext, String issuer)Attempt to resolve an existingOIDCProviderMetadataContextfrom which to copy.voidsetContextClassLookupStrategy(Function<MessageContext,? extends AbstractOIDCEntityContext> strategy)Set the context class lookup strategy.voidsetCopyContextStrategy(Function<MessageContext,OIDCProviderMetadataContext> strategy)Set the optional strategy for resolving an existing metadata context from which to copy data.voidsetProviderMetadataResolver(ProviderMetadataResolver resolver)Set theProviderMetadataResolverto use.-
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, doPreInvoke, 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
Logger.
-
providerResolver
@NonnullAfterInit private ProviderMetadataResolver providerResolver
Resolver used to look up OIDC provider information.
-
contextClassLookupStrategy
@Nonnull private Function<MessageContext,? extends AbstractOIDCEntityContext> contextClassLookupStrategy
Strategy to resolve the context class to add the resolved metadata too.
-
copyContextStrategy
@Nullable private Function<MessageContext,OIDCProviderMetadataContext> copyContextStrategy
Optional strategy for resolving an existing metadata context from which to copy data.
-
-
Method Detail
-
setContextClassLookupStrategy
public void setContextClassLookupStrategy(@Nonnull Function<MessageContext,? extends AbstractOIDCEntityContext> strategy)Set the context class lookup strategy.- Parameters:
strategy- the strategy.
-
setCopyContextStrategy
public void setCopyContextStrategy(@Nullable Function<MessageContext,OIDCProviderMetadataContext> strategy)Set the optional strategy for resolving an existing metadata context from which to copy data.- Parameters:
strategy- the strategy function
-
setProviderMetadataResolver
public void setProviderMetadataResolver(@Nonnull ProviderMetadataResolver resolver)Set theProviderMetadataResolverto use.- Parameters:
resolver- The resolver to use.
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doInvoke
protected void doInvoke(MessageContext messageContext) throws MessageHandlerException
- Specified by:
doInvokein classAbstractMessageHandler- Throws:
MessageHandlerException
-
resolveExisting
@Nullable protected OIDCProviderMetadataContext resolveExisting(@Nonnull MessageContext messageContext, @Nonnull String issuer)
Attempt to resolve an existingOIDCProviderMetadataContextfrom which to copy.The returned context will always be a fresh parent-less instance, suitable for the caller to directly store in the current message context.
- Parameters:
messageContext- the current message contextissuer- the identifier of the issuer against which to match- Returns:
- a new instance of
SAMLMetadataContext, or null if one can not be resolved
-
-