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.getCode()Returns the authorization code.getError()Returns theOAuth 2.0 Errorif the Authorization Request failed, otherwisenull.Returns the uri where the response was redirected to.getState()Returns the state.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.- Returns:
- the state
-
getCode
Returns the authorization code.- Returns:
- the authorization code
-
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
-