Class DefaultUserInfoRequestEncoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.authn.oidc.rp.encoding.impl.AbstractRequestEncoderFunction
net.shibboleth.idp.plugin.authn.oidc.rp.encoding.impl.DefaultUserInfoRequestEncoder
- All Implemented Interfaces:
Function<ProfileRequestContext,,org.apache.hc.core5.http.ClassicHttpRequest> Component,DestructableComponent,InitializableComponent
Default encoder for UserInfo requests. Supports either GET or POST requests.
-
Field Summary
FieldsModifier and TypeFieldDescriptionStrategy used to look up theHttpMethodused for this request.private static final StringThe HTTPS scheme.private final org.slf4j.LoggerClass logger.Strategy used to look up theAccessTokenResponseContextto set the parameters for. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddBearerTokenToGet(org.apache.hc.core5.http.io.support.ClassicRequestBuilder rb, AccessTokenResponseContext responseCtx) Add the bearer token to the Authorization header, used when issuing HTTP GET requests.private voidaddBearerTokenToPost(org.apache.hc.core5.http.io.support.ClassicRequestBuilder rb, AccessTokenResponseContext responseCtx) Add the bearer token to the 'access_token' parameter, used when issuing HTTP POST requests.org.apache.hc.core5.http.ClassicHttpRequestdoApply(ProfileRequestContext profileRequestContext, com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata providerMetadata) Encode a ClassicHttpRequest from the given context.voidsetHttpMethodLookupStrategy(Function<ProfileRequestContext, OAuth2AuthorizationProfileConfiguration.HttpRequestMethod> strategy) Set the strategy used to lookup the HTTP method to use in this request.voidsetTokenResponseContextLookupStrategy(Function<ProfileRequestContext, AccessTokenResponseContext> strategy) Set the strategy used to lookup theAccessTokenResponseContext.Methods inherited from class net.shibboleth.idp.plugin.authn.oidc.rp.encoding.impl.AbstractRequestEncoderFunction
apply, getAuthenticationRequest, getAuthenticationResponse, getClientAuthenticationContext, getProviderMetadataContext, setOIDCClientAuthenticationContextContextLookupStrategy, setProviderMetadataLookupStrategyMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
HTTPS
The HTTPS scheme.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
tokenResponseContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,AccessTokenResponseContext> tokenResponseContextLookupStrategyStrategy used to look up theAccessTokenResponseContextto set the parameters for. -
httpMethodLookupStrategy
@Nonnull private Function<ProfileRequestContext,OAuth2AuthorizationProfileConfiguration.HttpRequestMethod> httpMethodLookupStrategyStrategy used to look up theHttpMethodused for this request.
-
-
Constructor Details
-
DefaultUserInfoRequestEncoder
public DefaultUserInfoRequestEncoder()Constructor.
-
-
Method Details
-
setTokenResponseContextLookupStrategy
public void setTokenResponseContextLookupStrategy(Function<ProfileRequestContext, AccessTokenResponseContext> strategy) Set the strategy used to lookup theAccessTokenResponseContext.- Parameters:
strategy- the strategy
-
setHttpMethodLookupStrategy
public void setHttpMethodLookupStrategy(Function<ProfileRequestContext, OAuth2AuthorizationProfileConfiguration.HttpRequestMethod> strategy) Set the strategy used to lookup the HTTP method to use in this request.- Parameters:
strategy- the strategy
-
doApply
@Nullable public org.apache.hc.core5.http.ClassicHttpRequest doApply(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata providerMetadata) Description copied from class:AbstractRequestEncoderFunctionEncode a ClassicHttpRequest from the given context. Implementations should override this method.- Specified by:
doApplyin classAbstractRequestEncoderFunction- Parameters:
profileRequestContext- the profile request context.providerMetadata- the provider metadata.- Returns:
- the request to execute.
-
addBearerTokenToPost
private void addBearerTokenToPost(@Nonnull org.apache.hc.core5.http.io.support.ClassicRequestBuilder rb, @Nonnull AccessTokenResponseContext responseCtx) throws OIDCRPException Add the bearer token to the 'access_token' parameter, used when issuing HTTP POST requests.- Parameters:
rb- the request builder to use.responseCtx- the response context to find the access_token from.- Throws:
OIDCRPException- if there is an issue adding the bearer token to the 'access_token' parameter.
-
addBearerTokenToGet
private void addBearerTokenToGet(@Nonnull org.apache.hc.core5.http.io.support.ClassicRequestBuilder rb, @Nonnull AccessTokenResponseContext responseCtx) throws OIDCRPException Add the bearer token to the Authorization header, used when issuing HTTP GET requests.- Parameters:
rb- the request builder to use.responseCtx- the response context to find the access_token from.- Throws:
OIDCRPException- if there is an issue adding the bearer token to the Authorization header.
-