Package com.authlete.common.types
Enum GrantType
- java.lang.Object
-
- java.lang.Enum<GrantType>
-
- com.authlete.common.types.GrantType
-
- All Implemented Interfaces:
Serializable,Comparable<GrantType>
public enum GrantType extends Enum<GrantType>
Values forgrant_type.- Author:
- Takahiko Kawasaki
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTHORIZATION_CODE"authorization_code"(1), agrant_typeto request an access token and/or an ID token, and optionally a refresh token, using an authorization code.CIBA"urn:openid:params:grant-type:ciba"(6), agrant_typeto request an ID token, an access token, and optionally a refresh token, using a CIBA flow.CLIENT_CREDENTIALS"client_credentials"(4), agrant_typeto request an access token using a client's credentials.DEVICE_CODE"urn:ietf:params:oauth:grant-type:device_code"(7), agrant_typeto request an access token and optionally a refresh token, using Device Flow.IMPLICIT"implicit"(2), representing Implicit Flow.JWT_BEARER"urn:ietf:params:oauth:grant-type:jwt-bearer"(9), agrant_typeusing a JWT as an authorization grant.PASSWORD"password"(3), agrant_typeto request an access token using a resource owner's username and password.PRE_AUTHORIZED_CODE"urn:ietf:params:oauth:grant-type:pre-authorized_code"(10), agrant_typeto request an access token and optionally a refresh token, using Pre-Authorized Code Flow.REFRESH_TOKEN"refresh_token"(5), agrant_typeto request an access token, and optionally an ID token and/or a refresh token, using a refresh token.TOKEN_EXCHANGE"urn:ietf:params:oauth:grant-type:token-exchange"(8), agrant_typefor token exchange.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GrantTypegetByValue(short value)Find an instance of this enum by a value.shortgetValue()Get the integer representation of this enum instance.VersiongetVersion()Get the Authlete version since which this grant type has been supported.static GrantTypeparse(String grantType)ConvertStringtoGrantType.static GrantType[]toArray(int bits)static inttoBits(EnumSet<GrantType> set)static EnumSet<GrantType>toSet(int bits)static EnumSet<GrantType>toSet(GrantType[] array)StringtoString()static GrantTypevalueOf(String name)Returns the enum constant of this type with the specified name.static GrantType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AUTHORIZATION_CODE
public static final GrantType AUTHORIZATION_CODE
"authorization_code"(1), agrant_typeto request an access token and/or an ID token, and optionally a refresh token, using an authorization code.
-
IMPLICIT
public static final GrantType IMPLICIT
"implicit"(2), representing Implicit Flow.This is not a value for
grant_typebut listed in this enum because OpenID Connect Dynamic Client Registration 1.0 uses"implicit"as a value forgrant_typesof client metadata.
-
PASSWORD
public static final GrantType PASSWORD
"password"(3), agrant_typeto request an access token using a resource owner's username and password.
-
CLIENT_CREDENTIALS
public static final GrantType CLIENT_CREDENTIALS
"client_credentials"(4), agrant_typeto request an access token using a client's credentials.
-
REFRESH_TOKEN
public static final GrantType REFRESH_TOKEN
"refresh_token"(5), agrant_typeto request an access token, and optionally an ID token and/or a refresh token, using a refresh token.
-
CIBA
public static final GrantType CIBA
"urn:openid:params:grant-type:ciba"(6), agrant_typeto request an ID token, an access token, and optionally a refresh token, using a CIBA flow.CIBA is short for Client Initiated Backchannel Authentication.
- Since:
- 2.34
-
DEVICE_CODE
public static final GrantType DEVICE_CODE
"urn:ietf:params:oauth:grant-type:device_code"(7), agrant_typeto request an access token and optionally a refresh token, using Device Flow.- Since:
- 2.42
-
TOKEN_EXCHANGE
public static final GrantType TOKEN_EXCHANGE
"urn:ietf:params:oauth:grant-type:token-exchange"(8), agrant_typefor token exchange.- Since:
- 3.26, Authlete 2.3
- See Also:
- RFC 8693 OAuth 2.0 Token Exchange
-
JWT_BEARER
public static final GrantType JWT_BEARER
"urn:ietf:params:oauth:grant-type:jwt-bearer"(9), agrant_typeusing a JWT as an authorization grant.
-
PRE_AUTHORIZED_CODE
public static final GrantType PRE_AUTHORIZED_CODE
"urn:ietf:params:oauth:grant-type:pre-authorized_code"(10), agrant_typeto request an access token and optionally a refresh token, using Pre-Authorized Code Flow.- Since:
- 3.53, Authlete 3.0
- See Also:
- OpenID for Verifiable Credential Issuance, 3.5. Pre-Authorized Code Flow
-
-
Method Detail
-
values
public static GrantType[] 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 (GrantType c : GrantType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GrantType 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
-
getValue
public short getValue()
Get the integer representation of this enum instance.
-
getVersion
public Version getVersion()
Get the Authlete version since which this grant type has been supported.- Returns:
- The Authlete version since which this grant type has been supported.
- Since:
- 3.54
-
getByValue
public static GrantType getByValue(short value)
Find an instance of this enum by a value.- Parameters:
value- The integer representation of the instance to find.- Returns:
- An instance of this enum, or
nullif not found.
-
parse
public static GrantType parse(String grantType)
ConvertStringtoGrantType.- Parameters:
grantType- A grant type. For example,"authorization_code".- Returns:
GrantTypeinstance, ornull.
-
toArray
public static GrantType[] toArray(int bits)
-
-