Class OAuth2AuthorizationResponse
- java.lang.Object
-
- org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationResponse
-
public final class OAuth2AuthorizationResponse extends java.lang.ObjectA representation of an OAuth 2.0 Authorization Response for the authorization code grant type.- Since:
- 5.0
- See Also:
OAuth2Error, Section 4.1.2 Authorization Response
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOAuth2AuthorizationResponse.BuilderA builder forOAuth2AuthorizationResponse.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OAuth2AuthorizationResponse.Buildererror(java.lang.String errorCode)Returns a newOAuth2AuthorizationResponse.Builder, initialized with the error code.java.lang.StringgetCode()Returns the authorization code.OAuth2ErrorgetError()Returns theOAuth 2.0 Errorif the Authorization Request failed, otherwisenull.java.lang.StringgetRedirectUri()Returns the uri where the response was redirected to.java.lang.StringgetState()Returns the state.booleanstatusError()Returnstrueif the Authorization Request failed, otherwisefalse.booleanstatusOk()Returnstrueif the Authorization Request succeeded, otherwisefalse.static OAuth2AuthorizationResponse.Buildersuccess(java.lang.String code)Returns a newOAuth2AuthorizationResponse.Builder, initialized with the authorization code.
-
-
-
Method Detail
-
getRedirectUri
public java.lang.String getRedirectUri()
Returns the uri where the response was redirected to.- Returns:
- the uri where the response was redirected to
-
getState
public java.lang.String getState()
Returns the state.- Returns:
- the state
-
getCode
public java.lang.String getCode()
Returns the authorization code.- Returns:
- the authorization code
-
getError
public OAuth2Error 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
public static OAuth2AuthorizationResponse.Builder success(java.lang.String code)
Returns a newOAuth2AuthorizationResponse.Builder, initialized with the authorization code.- Parameters:
code- the authorization code- Returns:
- the
OAuth2AuthorizationResponse.Builder
-
error
public static OAuth2AuthorizationResponse.Builder error(java.lang.String errorCode)
Returns a newOAuth2AuthorizationResponse.Builder, initialized with the error code.- Parameters:
errorCode- the error code- Returns:
- the
OAuth2AuthorizationResponse.Builder
-
-