Class OAuth2AuthorizationRequest.AbstractBuilder<T extends OAuth2AuthorizationRequest,B extends OAuth2AuthorizationRequest.AbstractBuilder<T,B>>

java.lang.Object
org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest.AbstractBuilder<T,B>
Type Parameters:
T - the type of authorization request
B - the type of the builder
Direct Known Subclasses:
OAuth2AuthorizationRequest.Builder
Enclosing class:
OAuth2AuthorizationRequest

protected abstract static class OAuth2AuthorizationRequest.AbstractBuilder<T extends OAuth2AuthorizationRequest,B extends OAuth2AuthorizationRequest.AbstractBuilder<T,B>> extends Object
A builder for subclasses of OAuth2AuthorizationRequest.
  • Constructor Details

    • AbstractBuilder

      protected AbstractBuilder()
  • Method Details

    • getThis

      protected final B getThis()
    • authorizationUri

      public B authorizationUri(String authorizationUri)
      Sets the uri for the authorization endpoint.
      Parameters:
      authorizationUri - the uri for the authorization endpoint
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
    • clientId

      public B clientId(String clientId)
      Sets the client identifier.
      Parameters:
      clientId - the client identifier
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
    • redirectUri

      public B redirectUri(String redirectUri)
      Sets the uri for the redirection endpoint.
      Parameters:
      redirectUri - the uri for the redirection endpoint
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
    • scope

      public B scope(String... scope)
      Sets the scope(s).
      Parameters:
      scope - the scope(s)
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
    • scopes

      public B scopes(Set<String> scopes)
      Sets the scope(s).
      Parameters:
      scopes - the scope(s)
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
    • state

      public B state(String state)
      Sets the state.
      Parameters:
      state - the state
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
    • additionalParameters

      public B additionalParameters(Map<String,Object> additionalParameters)
      Sets the additional parameter(s) used in the request.
      Parameters:
      additionalParameters - the additional parameter(s) used in the request
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
    • additionalParameters

      public B additionalParameters(Consumer<Map<String,Object>> additionalParametersConsumer)
      A Consumer to be provided access to the additional parameter(s) allowing the ability to add, replace, or remove.
      Parameters:
      additionalParametersConsumer - a Consumer of the additional parameters
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
      Since:
      5.3
    • parameters

      public B parameters(Consumer<Map<String,Object>> parametersConsumer)
      A Consumer to be provided access to all the parameters allowing the ability to add, replace, or remove.
      Parameters:
      parametersConsumer - a Consumer of all the parameters
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
      Since:
      5.3
    • attributes

      public B attributes(Map<String,Object> attributes)
      Sets the attributes associated to the request.
      Parameters:
      attributes - the attributes associated to the request
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
      Since:
      5.2
    • attributes

      public B attributes(Consumer<Map<String,Object>> attributesConsumer)
      A Consumer to be provided access to the attribute(s) allowing the ability to add, replace, or remove.
      Parameters:
      attributesConsumer - a Consumer of the attribute(s)
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
      Since:
      5.3
    • authorizationRequestUri

      public B authorizationRequestUri(String authorizationRequestUri)
      Sets the URI string representation of the OAuth 2.0 Authorization Request.

      NOTE: The URI string is required to be encoded in the application/x-www-form-urlencoded MIME format.

      Parameters:
      authorizationRequestUri - the URI string representation of the OAuth 2.0 Authorization Request
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
      Since:
      5.1
    • authorizationRequestUri

      public B authorizationRequestUri(Function<org.springframework.web.util.UriBuilder,URI> authorizationRequestUriFunction)
      A Function to be provided a UriBuilder representation of the OAuth 2.0 Authorization Request allowing for further customizations.
      Parameters:
      authorizationRequestUriFunction - a Function to be provided a UriBuilder representation of the OAuth 2.0 Authorization Request
      Returns:
      the OAuth2AuthorizationRequest.AbstractBuilder
      Since:
      5.3
    • build

      public abstract T build()
    • getParameters

      protected Map<String,Object> getParameters()