Class OAuth2AuthorizationResponse
java.lang.Object
org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponse
A representation of an OAuth 2.0 Authorization Response for the authorization code
grant type.
- Since:
- 5.0
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a newOAuth2AuthorizationResponse.Builder
, initialized with the error code.getCode()
Returns the authorization code.getError()
Returns theOAuth 2.0 Error
if the Authorization Request failed, otherwisenull
.Returns the uri where the response was redirected to.getState()
Returns the state.boolean
Returnstrue
if the Authorization Request failed, otherwisefalse
.boolean
statusOk()
Returnstrue
if 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 Error
if the Authorization Request failed, otherwisenull
.- Returns:
- the
OAuth2Error
if the Authorization Request failed, otherwisenull
-
statusOk
public boolean statusOk()Returnstrue
if the Authorization Request succeeded, otherwisefalse
.- Returns:
true
if the Authorization Request succeeded, otherwisefalse
-
statusError
public boolean statusError()Returnstrue
if the Authorization Request failed, otherwisefalse
.- Returns:
true
if 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
-