Class AbstractRequestEncoderFunction
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.oidc.profile.encoding.impl.AbstractRequestEncoderFunction
- All Implemented Interfaces:
Function<ProfileRequestContext,,org.apache.hc.core5.http.ClassicHttpRequest> Component,DestructableComponent,InitializableComponent
- Direct Known Subclasses:
AuthCodeTokenRequestEncoder,UserInfoRequestEncoder
public abstract class AbstractRequestEncoderFunction
extends AbstractInitializableComponent
implements Function<ProfileRequestContext,org.apache.hc.core5.http.ClassicHttpRequest>
Abstract request encoder function that pulls out various contexts and request/response messages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponseOIDC authentication response from upstream OP.The context used to store client authentication information for communication with a upstream OP.private final org.slf4j.LoggerClass logger.The strategy used to lookup or create theOAuth2ClientAuthenticationContext.private OIDCProviderMetadataContextOIDC Metadata context.Lookup strategy to locate the OP metadata to use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hc.core5.http.ClassicHttpRequestapply(ProfileRequestContext profileRequestContext) protected abstract org.apache.hc.core5.http.ClassicHttpRequestdoApply(ProfileRequestContext profileRequestContext, com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata providerMetadata) Encode a ClassicHttpRequest from the given context.protected com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponseReturns the authentication response from the upstream OP.protected OAuth2ClientAuthenticationContextGet the client authentication context.protected OIDCProviderMetadataContextReturns the OIDC provider metadata context.voidsetOAuth2ClientAuthenticationContextLookupStrategy(Function<ProfileRequestContext, OAuth2ClientAuthenticationContext> strgy) Set the strategy to lookup theOAuth2ClientAuthenticationContext.voidsetProviderMetadataLookupStrategy(Function<ProfileRequestContext, OIDCProviderMetadataContext> strategy) Set the lookup strategy to locate the OpenID providers metadata.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
providerMetadataLookupStrategy
@Nonnull private Function<ProfileRequestContext,OIDCProviderMetadataContext> providerMetadataLookupStrategyLookup strategy to locate the OP metadata to use. -
oauth2ClientAuthenticationContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,OAuth2ClientAuthenticationContext> oauth2ClientAuthenticationContextLookupStrategyThe strategy used to lookup or create theOAuth2ClientAuthenticationContext. -
authnResponse
@Nullable private com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse authnResponseOIDC authentication response from upstream OP. -
providerMetadataContext
OIDC Metadata context. -
clientAuthnContext
The context used to store client authentication information for communication with a upstream OP.
-
-
Constructor Details
-
AbstractRequestEncoderFunction
protected AbstractRequestEncoderFunction()Constructor.
-
-
Method Details
-
setOAuth2ClientAuthenticationContextLookupStrategy
public void setOAuth2ClientAuthenticationContextLookupStrategy(@Nonnull Function<ProfileRequestContext, OAuth2ClientAuthenticationContext> strgy) Set the strategy to lookup theOAuth2ClientAuthenticationContext.- Parameters:
strgy- the strategy.
-
setProviderMetadataLookupStrategy
public void setProviderMetadataLookupStrategy(@Nonnull Function<ProfileRequestContext, OIDCProviderMetadataContext> strategy) Set the lookup strategy to locate the OpenID providers metadata.- Parameters:
strategy- the strategy.
-
getAuthenticationResponse
@Nullable protected com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse getAuthenticationResponse()Returns the authentication response from the upstream OP.- Returns:
- the authentication response.
-
getClientAuthenticationContext
Get the client authentication context.- Returns:
- the client context.
-
getProviderMetadataContext
Returns the OIDC provider metadata context.- Returns:
- The provider metadata context.
-
apply
@Nullable public org.apache.hc.core5.http.ClassicHttpRequest apply(@Nullable ProfileRequestContext profileRequestContext) Creates the HTTP request. Any error in creating the request should return
nullto indicate failure.- Specified by:
applyin interfaceFunction<ProfileRequestContext,org.apache.hc.core5.http.ClassicHttpRequest>
-
doApply
@Nullable protected abstract org.apache.hc.core5.http.ClassicHttpRequest doApply(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata providerMetadata) Encode a ClassicHttpRequest from the given context. Implementations should override this method.- Parameters:
profileRequestContext- the profile request context.providerMetadata- the provider metadata.- Returns:
- the request to execute.
-