Class OAuth2AuthorizationRequest
- java.lang.Object
-
- org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest
-
- All Implemented Interfaces:
java.io.Serializable
public final class OAuth2AuthorizationRequest extends java.lang.Object implements java.io.Serializable
A representation of an OAuth 2.0 Authorization Request for the authorization code grant type or implicit grant type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OAuth2AuthorizationRequest.Builder
A builder forOAuth2AuthorizationRequest
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OAuth2AuthorizationRequest.Builder
authorizationCode()
Returns a newOAuth2AuthorizationRequest.Builder
, initialized with the authorization code grant type.static OAuth2AuthorizationRequest.Builder
from(OAuth2AuthorizationRequest authorizationRequest)
Returns a newOAuth2AuthorizationRequest.Builder
, initialized with the values from the providedauthorizationRequest
.java.util.Map<java.lang.String,java.lang.Object>
getAdditionalParameters()
Returns the additional parameters used in the request.<T> T
getAttribute(java.lang.String name)
Returns the value of an attribute associated to the request, ornull
if not available.java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
Returns the attributes associated to the request.java.lang.String
getAuthorizationRequestUri()
Returns theURI
string representation of the OAuth 2.0 Authorization Request.java.lang.String
getAuthorizationUri()
Returns the uri for the authorization endpoint.java.lang.String
getClientId()
Returns the client identifier.AuthorizationGrantType
getGrantType()
Returns thegrant type
.java.lang.String
getRedirectUri()
Returns the uri for the redirection endpoint.OAuth2AuthorizationResponseType
getResponseType()
Returns theresponse type
.java.util.Set<java.lang.String>
getScopes()
Returns the scope(s).java.lang.String
getState()
Returns the state.static OAuth2AuthorizationRequest.Builder
implicit()
Returns a newOAuth2AuthorizationRequest.Builder
, initialized with the implicit grant type.
-
-
-
Method Detail
-
getAuthorizationUri
public java.lang.String getAuthorizationUri()
Returns the uri for the authorization endpoint.- Returns:
- the uri for the authorization endpoint
-
getGrantType
public AuthorizationGrantType getGrantType()
Returns thegrant type
.- Returns:
- the
AuthorizationGrantType
-
getResponseType
public OAuth2AuthorizationResponseType getResponseType()
Returns theresponse type
.- Returns:
- the
OAuth2AuthorizationResponseType
-
getClientId
public java.lang.String getClientId()
Returns the client identifier.- Returns:
- the client identifier
-
getRedirectUri
public java.lang.String getRedirectUri()
Returns the uri for the redirection endpoint.- Returns:
- the uri for the redirection endpoint
-
getScopes
public java.util.Set<java.lang.String> getScopes()
Returns the scope(s).- Returns:
- the scope(s)
-
getState
public java.lang.String getState()
Returns the state.- Returns:
- the state
-
getAdditionalParameters
public java.util.Map<java.lang.String,java.lang.Object> getAdditionalParameters()
Returns the additional parameters used in the request.- Returns:
- a
Map
of the additional parameters used in the request
-
getAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns the attributes associated to the request.- Returns:
- a
Map
of the attributes associated to the request - Since:
- 5.2
-
getAttribute
public <T> T getAttribute(java.lang.String name)
Returns the value of an attribute associated to the request, ornull
if not available.- Type Parameters:
T
- the type of the attribute- Parameters:
name
- the name of the attribute- Returns:
- the value of the attribute associated to the request
- Since:
- 5.2
-
getAuthorizationRequestUri
public java.lang.String getAuthorizationRequestUri()
Returns theURI
string representation of the OAuth 2.0 Authorization Request.NOTE: The
URI
string is encoded in theapplication/x-www-form-urlencoded
MIME format.- Returns:
- the
URI
string representation of the OAuth 2.0 Authorization Request - Since:
- 5.1
-
authorizationCode
public static OAuth2AuthorizationRequest.Builder authorizationCode()
Returns a newOAuth2AuthorizationRequest.Builder
, initialized with the authorization code grant type.- Returns:
- the
OAuth2AuthorizationRequest.Builder
-
implicit
public static OAuth2AuthorizationRequest.Builder implicit()
Returns a newOAuth2AuthorizationRequest.Builder
, initialized with the implicit grant type.- Returns:
- the
OAuth2AuthorizationRequest.Builder
-
from
public static OAuth2AuthorizationRequest.Builder from(OAuth2AuthorizationRequest authorizationRequest)
Returns a newOAuth2AuthorizationRequest.Builder
, initialized with the values from the providedauthorizationRequest
.- Parameters:
authorizationRequest
- the authorization request used for initializing theOAuth2AuthorizationRequest.Builder
- Returns:
- the
OAuth2AuthorizationRequest.Builder
- Since:
- 5.1
-
-