Class OIDCProviderMetadataLookupHandler
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
net.shibboleth.idp.plugin.authn.oidc.rp.metadata.impl.OIDCProviderMetadataLookupHandler
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
Handler for inbound OIDC protocol messages that attempts to locate OIDC metadata for a OP (issuer),
and attaches it with a
OIDCMetadataContext as a child of a pre-existing instance of MessageContext.
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
FieldsModifier and TypeFieldDescriptionprivate Function<MessageContext,? extends AbstractOIDCEntityContext> Strategy to resolve the context class to add the resolved metadata too.Optional strategy for resolving an existing metadata context from which to copy data.private final org.slf4j.LoggerLogger.private ProviderMetadataResolverResolver used to look up OIDC provider information. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected 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.voidSet the optional strategy for resolving an existing metadata context from which to copy data.voidSet theProviderMetadataResolverto use.Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, doPreInvoke, 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. -
providerResolver
Resolver used to look up OIDC provider information. -
contextClassLookupStrategy
@Nonnull private Function<MessageContext,? extends AbstractOIDCEntityContext> contextClassLookupStrategyStrategy to resolve the context class to add the resolved metadata too. -
copyContextStrategy
Optional strategy for resolving an existing metadata context from which to copy data.
-
-
Constructor Details
-
OIDCProviderMetadataLookupHandler
public OIDCProviderMetadataLookupHandler()Constructor.
-
-
Method Details
-
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
Set theProviderMetadataResolverto use.- Parameters:
resolver- The resolver to use.
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doInvoke
- 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
-