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 Details

  • Constructor Details

    • AbstractRequestEncoderFunction

      protected AbstractRequestEncoderFunction()
      Constructor.
  • Method Details

    • setOAuth2ClientAuthenticationContextLookupStrategy

      public void setOAuth2ClientAuthenticationContextLookupStrategy(@Nonnull Function<ProfileRequestContext,OAuth2ClientAuthenticationContext> strgy)
      Set the strategy to lookup the OAuth2ClientAuthenticationContext.
      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

      @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.hc.core5.http.ClassicHttpRequest apply(@Nullable ProfileRequestContext profileRequestContext)

      Creates the HTTP request. Any error in creating the request should return null to indicate failure.

      Specified by:
      apply in interface Function<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.