Class AbstractRequestEncoderFunction
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.plugin.authn.oidc.rp.encoding.impl.AbstractRequestEncoderFunction
-
- All Implemented Interfaces:
Function<ProfileRequestContext,org.apache.http.client.methods.HttpUriRequest>,Component,DestructableComponent,InitializableComponent
- Direct Known Subclasses:
DefaultAuthCodeTokenRequestEncoder,DefaultUserInfoRequestEncoder
public abstract class AbstractRequestEncoderFunction extends AbstractInitializableComponent implements Function<ProfileRequestContext,org.apache.http.client.methods.HttpUriRequest>
Abstract request encoder function that pulls out various contexts and request/response messages.
-
-
Field Summary
Fields Modifier and Type Field Description private OIDCAuthenticationRequestauthnRequestOIDC authentication request built by the IdP.private com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponseauthnResponseOIDC authentication response from upstream OP.private OAuth2ClientAuthenticationContextclientAuthnContextThe context used to store client authentication information for communication with a upstream OP.private org.slf4j.LoggerlogClass logger.private Function<ProfileRequestContext,OAuth2ClientAuthenticationContext>oauth2ClientAuthenticationContextLookupStrategyThe strategy used to lookup or create theOAuth2ClientAuthenticationContext.private OIDCProviderMetadataContextproviderMetadataContextOIDC Metadata context.private Function<ProfileRequestContext,OIDCProviderMetadataContext>providerMetadataLookupStrategyLookup strategy to locate the OP metadata to use.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRequestEncoderFunction()Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.http.client.methods.HttpUriRequestapply(ProfileRequestContext profileRequestContext)protected abstract org.apache.http.client.methods.HttpUriRequestdoApply(ProfileRequestContext profileRequestContext)Encode a HttpUriRequest from the given context.protected OIDCAuthenticationRequestgetAuthenticationRequest()Returns the authentication request build by this IdP.protected com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponsegetAuthenticationResponse()Returns the authentication response from the upstream OP.protected OAuth2ClientAuthenticationContextgetClientAuthenticationContext()Get the client authentication context.protected OIDCProviderMetadataContextgetProviderMetadataContext()Returns the OIDC provider metadata context.voidsetOIDCClientAuthenticationContextContextLookupStrategy(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.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
providerMetadataLookupStrategy
@Nonnull private Function<ProfileRequestContext,OIDCProviderMetadataContext> providerMetadataLookupStrategy
Lookup strategy to locate the OP metadata to use.
-
oauth2ClientAuthenticationContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,OAuth2ClientAuthenticationContext> oauth2ClientAuthenticationContextLookupStrategy
The strategy used to lookup or create theOAuth2ClientAuthenticationContext.
-
authnResponse
@Nullable private com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse authnResponse
OIDC authentication response from upstream OP.
-
authnRequest
@Nullable private OIDCAuthenticationRequest authnRequest
OIDC authentication request built by the IdP.
-
providerMetadataContext
@Nullable private OIDCProviderMetadataContext providerMetadataContext
OIDC Metadata context.
-
clientAuthnContext
@Nullable private OAuth2ClientAuthenticationContext clientAuthnContext
The context used to store client authentication information for communication with a upstream OP.
-
-
Method Detail
-
setOIDCClientAuthenticationContextContextLookupStrategy
public void setOIDCClientAuthenticationContextContextLookupStrategy(@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.
-
getAuthenticationRequest
@Nullable protected OIDCAuthenticationRequest getAuthenticationRequest()
Returns the authentication request build by this IdP.- Returns:
- the authentication request.
-
getClientAuthenticationContext
@Nullable protected OAuth2ClientAuthenticationContext getClientAuthenticationContext()
Get the client authentication context.- Returns:
- the client context.
-
getProviderMetadataContext
@Nullable protected OIDCProviderMetadataContext getProviderMetadataContext()
Returns the OIDC provider metadata context.- Returns:
- The provider metadata context.
-
apply
@Nullable public org.apache.http.client.methods.HttpUriRequest apply(@Nonnull ProfileRequestContext profileRequestContext)Creates the HTTP request. Any error in creating the request should return
nullto indicate failure.- Specified by:
applyin interfaceFunction<ProfileRequestContext,org.apache.http.client.methods.HttpUriRequest>
-
doApply
@Nullable protected abstract org.apache.http.client.methods.HttpUriRequest doApply(@Nonnull ProfileRequestContext profileRequestContext)Encode a HttpUriRequest from the given context. Implementations should override this method.- Parameters:
profileRequestContext- the profile request context.- Returns:
- the request to execute.
-
-