Class AuthCodeTokenRequestEncoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.oidc.profile.encoding.impl.AbstractRequestEncoderFunction
net.shibboleth.oidc.profile.encoding.impl.AuthCodeTokenRequestEncoder
- All Implemented Interfaces:
Function<ProfileRequestContext,,org.apache.hc.core5.http.ClassicHttpRequest> Component,DestructableComponent,InitializableComponent
A token request encoder that builds an OAuth2.0 Access Token Request for an authorization_code grant and returns an
HttpUriRequest.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private Function<ProfileRequestContext,String> The lookup strategy to pull out the PKCE code_verifier to send in the token request.private Function<ProfileRequestContext,URI> The strategy used to look up the redirect URI to use in the token request. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hc.core5.http.ClassicHttpRequestconvertHttpRequest(com.nimbusds.oauth2.sdk.http.HTTPRequest request) Convert the internally usedHTTPRequestto the externally presentedHttpUriRequest.org.apache.hc.core5.http.ClassicHttpRequestdoApply(ProfileRequestContext profileRequestContext, com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata providerMetadata) Encode a ClassicHttpRequest from the given context.voidSet the strategy used to look up the PKCE code_verifier to send in the token request.voidSet the strategy used to look up the redirect URI to use in the token request.Methods inherited from class net.shibboleth.oidc.profile.encoding.impl.AbstractRequestEncoderFunction
apply, getAuthenticationResponse, getClientAuthenticationContext, getProviderMetadataContext, setOAuth2ClientAuthenticationContextLookupStrategy, setProviderMetadataLookupStrategyMethods 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. -
pkceCodeVerifierLookupStrategy
The lookup strategy to pull out the PKCE code_verifier to send in the token request. -
redirectUriLookupStrategy
The strategy used to look up the redirect URI to use in the token request. This will typically be the same URI used in the authorization request, but may be overridden if necessary. If not set, no redirect URI will be included in the token request which may result in an error on the OpenID Provider.
-
-
Constructor Details
-
AuthCodeTokenRequestEncoder
public AuthCodeTokenRequestEncoder()
-
-
Method Details
-
setRedirectUriLookupStrategy
Set the strategy used to look up the redirect URI to use in the token request. This will typically be the same URI used in the authorization request, but may be overridden if necessary. If not set, no redirect URI will be included in the token request which may result in an error at the OpenID Provider.- Parameters:
strategy- The RedirectUriLookupStrategy to set.
-
setPkceCodeVerifierLookupStrategy
public void setPkceCodeVerifierLookupStrategy(@Nonnull Function<ProfileRequestContext, String> strategy) Set the strategy used to look up the PKCE code_verifier to send in the token request.- Parameters:
strategy- The PKCE lookup strategy to set.
-
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.
-
convertHttpRequest
@Nullable private org.apache.hc.core5.http.ClassicHttpRequest convertHttpRequest(@Nonnull com.nimbusds.oauth2.sdk.http.HTTPRequest request) Convert the internally usedHTTPRequestto the externally presentedHttpUriRequest.- Parameters:
request- the HTTP request to convert- Returns:
- the convert HTTP request
-