Class OAuthAuthorizationRequest

java.lang.Object
net.shibboleth.oidc.profile.core.OAuthAuthorizationRequest
Direct Known Subclasses:
OIDCAuthenticationRequest

public class OAuthAuthorizationRequest extends Object
An OAuth 2.0 authorization request.

This class is mutable and not thread-safe.

  • Field Details

    • clientID

      @Nonnull private final ClientID clientID
      The client identifier. Required.
    • state

      @Nullable private State state
      The state.
    • redirectURI

      @Nullable private URI redirectURI
      The redirect URI to which the response will be sent.
    • responseType

      @Nullable private ResponseType responseType
      The authorization processing flow to use.
    • endpointURI

      @Nullable private URI endpointURI
      The request endpoint.
    • scope

      @Nonnull private final Scope scope
      The requested scopes.
    • responseMode

      @Nullable private ResponseMode responseMode
      The response mode. Optional.
    • defaultResponseMode

      @Nullable private ResponseMode defaultResponseMode
      The default response mode for the given response_type. Can be used to determine if the response_mode should be included in an authentication request.
    • codeVerifier

      @Nullable private String codeVerifier
      The authorisation code_verifier for Proof Key for Code Exchange.
    • codeChallenge

      @Nullable private String codeChallenge
      The authorisation code_challenge for Proof Key for Code Exchange.
    • codeChallengeMethod

      @Nullable private OAuthAuthorizationRequest.CodeChallengeMethod codeChallengeMethod
      The authorisation code_challenge_method used for Proof Key for Code Exchange.
  • Constructor Details

    • OAuthAuthorizationRequest

      public OAuthAuthorizationRequest(@Nonnull ClientID id)
      Constructor.
      Parameters:
      id - the clientID. Never null.
  • Method Details

    • setDefaultResponseMode

      public void setDefaultResponseMode(@Nullable ResponseMode mode)
      Set the default response_mode for the given response_type.
      Parameters:
      mode - the default response_mode for the given response_type
      Since:
      2.2.0
    • getDefaultResponseMode

      @Nullable public ResponseMode getDefaultResponseMode()
      Get the response_mode to use with this authentication request.
      Returns:
      the default response_mode
      Since:
      2.2.0
    • getClientID

      @Nonnull public ClientID getClientID()
      Get the client ID.
      Returns:
      the clientID.
    • getState

      @Nullable public State getState()
      Get the state.
      Returns:
      the state.
    • setState

      public void setState(@Nullable State theState)
      Set the state. Optional.
      Parameters:
      theState - The state to set.
    • getRedirectURI

      @Nullable public URI getRedirectURI()
      Get the redirect_uri.
      Returns:
      the redirectURI.
    • setRedirectURI

      public void setRedirectURI(@Nonnull URI uri)
      Set the redirect_uri.
      Parameters:
      uri - The redirect_uri to set.
    • getResponseType

      @Nullable public ResponseType getResponseType()
      Get the response type.
      Returns:
      the responseType.
    • setResponseType

      public void setResponseType(@Nonnull ResponseType type)
      Set the response type.
      Parameters:
      type - The responseType to set.
    • getEndpointURI

      @Nullable public URI getEndpointURI()
      Get the endpoint_uri.
      Returns:
      the endpoint_uri.
    • setEndpointURI

      public void setEndpointURI(@Nonnull URI uri)
      Set the endpoint_uri.
      Parameters:
      uri - The endpointURI to set.
    • getScope

      @Nonnull public Scope getScope()
      Get the scope.
      Returns:
      the scope.
    • getResponseMode

      @Nullable public ResponseMode getResponseMode()
      Get the response mode.
      Returns:
      the responseMode.
    • setResponseMode

      public void setResponseMode(@Nullable ResponseMode mode)
      Set the response mode to be used with the ongoing authentication request. This can be null if the default response_mode is to be used by the OP.
      Parameters:
      mode - the response mode. null if default mode is to be used.
    • setCodeVerifier

      public void setCodeVerifier(@Nullable String code)
      Set the authorisation code_verifier for Proof Key for Code Exchange.
      Parameters:
      code - The code_verifier to set.
      Since:
      3.1.0
    • getCodeVerifier

      @Nullable public String getCodeVerifier()
      Get the authorisation code_verifier for Proof Key for Code Exchange.
      Returns:
      the code_verifier.
      Since:
      3.1.0
    • setCodeChallenge

      public void setCodeChallenge(@Nullable String code)
      Get the authorisation code_challenge for Proof Key for Code Exchange.
      Parameters:
      code - The code_challenge to set.
      Since:
      3.1.0
    • getCodeChallenge

      @Nullable public String getCodeChallenge()
      Get the authorisation code_challenge (which was derived from the code_verifier) for Proof Key for Code Exchange.
      Returns:
      Returns the code_challenge.
      Since:
      3.1.0
    • getCodeChallengeMethod

      @Nullable public OAuthAuthorizationRequest.CodeChallengeMethod getCodeChallengeMethod()
      Get the code_challenge_method used to transform the code_verifier into a code_challenge.
      Returns:
      Returns the code_challenge_method.
      Since:
      3.1.0
    • setCodeChallengeMethod

      public void setCodeChallengeMethod(@Nullable OAuthAuthorizationRequest.CodeChallengeMethod method)
      Set the code_challenge_method used to transform the code_verifier into a code_challenge.
      Parameters:
      method - The code_challenge_method to set.
      Since:
      3.1.0