Class OAuth2AuthorizationResponse
java.lang.Object
org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponse
- All Implemented Interfaces:
Serializable
A representation of an OAuth 2.0 Authorization Response for the authorization code
grant type.
- Since:
- 5.0
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns a newOAuth2AuthorizationResponse.Builder, initialized with the error code.@Nullable StringgetCode()Returns the authorization code, ornullif the response is an error response.@Nullable OAuth2ErrorgetError()Returns theOAuth 2.0 Errorif the Authorization Request failed, otherwisenull.Returns the uri where the response was redirected to.@Nullable StringgetState()Returns the state, ornullif not present.booleanReturnstrueif the Authorization Request failed, otherwisefalse.booleanstatusOk()Returnstrueif the Authorization Request succeeded, otherwisefalse.Returns a newOAuth2AuthorizationResponse.Builder, initialized with the authorization code.
-
Method Details
-
getRedirectUri
Returns the uri where the response was redirected to.- Returns:
- the uri where the response was redirected to
-
getState
Returns the state, ornullif not present.- Returns:
- the state, or
null
-
getCode
Returns the authorization code, ornullif the response is an error response.- Returns:
- the authorization code, or
null
-
getError
Returns theOAuth 2.0 Errorif the Authorization Request failed, otherwisenull.- Returns:
- the
OAuth2Errorif the Authorization Request failed, otherwisenull
-
statusOk
public boolean statusOk()Returnstrueif the Authorization Request succeeded, otherwisefalse.- Returns:
trueif the Authorization Request succeeded, otherwisefalse
-
statusError
public boolean statusError()Returnstrueif the Authorization Request failed, otherwisefalse.- Returns:
trueif the Authorization Request failed, otherwisefalse
-
success
Returns a newOAuth2AuthorizationResponse.Builder, initialized with the authorization code.- Parameters:
code- the authorization code- Returns:
- the
OAuth2AuthorizationResponse.Builder
-
error
Returns a newOAuth2AuthorizationResponse.Builder, initialized with the error code.- Parameters:
errorCode- the error code- Returns:
- the
OAuth2AuthorizationResponse.Builder
-