Package com.authlete.common.dto
Enum TokenResponse.Action
- java.lang.Object
-
- java.lang.Enum<TokenResponse.Action>
-
- com.authlete.common.dto.TokenResponse.Action
-
- All Implemented Interfaces:
Serializable
,Comparable<TokenResponse.Action>
- Enclosing class:
- TokenResponse
public static enum TokenResponse.Action extends Enum<TokenResponse.Action>
The next action that the service implementation should take.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BAD_REQUEST
The token request from the client was wrong.ID_TOKEN_REISSUABLE
The token request from the client was a valid token request using the refresh token flow and an ID token can be reissued.INTERNAL_SERVER_ERROR
The request from the service was wrong or an error occurred in Authlete.INVALID_CLIENT
Authentication of the client application failed.JWT_BEARER
The token request from the client was a valid token request with the grant type"urn:ietf:params:oauth:grant-type:jwt-bearer"
.OK
The token request from the client was valid.PASSWORD
The token request from the client application was valid and the grant type is"password"
.TOKEN_EXCHANGE
The token request from the client was a valid token exchange request.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TokenResponse.Action
valueOf(String name)
Returns the enum constant of this type with the specified name.static TokenResponse.Action[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INVALID_CLIENT
public static final TokenResponse.Action INVALID_CLIENT
Authentication of the client application failed. The service implementation should return either"400 Bad Request"
or"401 Unauthorized"
to the client application.
-
INTERNAL_SERVER_ERROR
public static final TokenResponse.Action INTERNAL_SERVER_ERROR
The request from the service was wrong or an error occurred in Authlete. The service implementation should return"500 Internal Server Error"
to the client application.
-
BAD_REQUEST
public static final TokenResponse.Action BAD_REQUEST
The token request from the client was wrong. The service implementation should return"400 Bad Request"
to the client application.
-
PASSWORD
public static final TokenResponse.Action PASSWORD
The token request from the client application was valid and the grant type is"password"
. The service implementation should validate the credentials of the resource owner and call Authlete's/auth/token/issue
API or/auth/token/fail
API according to the result of the validation.
-
OK
public static final TokenResponse.Action OK
The token request from the client was valid. The service implementation should return"200 OK"
to the client application with an access token.
-
TOKEN_EXCHANGE
public static final TokenResponse.Action TOKEN_EXCHANGE
The token request from the client was a valid token exchange request. The service implementation should take necessary actions (e.g. create an access token), generate a response and return it to the client application.- Since:
- 3.26, Authlete 2.3
- See Also:
- RFC 8693 OAuth 2.0 Token Exchange
-
JWT_BEARER
public static final TokenResponse.Action JWT_BEARER
The token request from the client was a valid token request with the grant type"urn:ietf:params:oauth:grant-type:jwt-bearer"
. The service implementation must verify the signature of the assertion, create an access token, generate a response and return it to the client application.
-
ID_TOKEN_REISSUABLE
public static final TokenResponse.Action ID_TOKEN_REISSUABLE
The token request from the client was a valid token request using the refresh token flow and an ID token can be reissued.The implementation of the token endpoint can choose either (1) to execute the same steps as for the "
OK
" action which results in the same behavior as before, or (2) to call the/idtoken/reissue
API to reissue a new ID token together with a new access token and a refresh token.See the description of the
TokenResponse
class for details.- Since:
- 3.68, Authlete 2.3.8, Authlete 3.0
-
-
Method Detail
-
values
public static TokenResponse.Action[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TokenResponse.Action c : TokenResponse.Action.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TokenResponse.Action valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-