Enum ClientAuthMethod
- java.lang.Object
-
- java.lang.Enum<ClientAuthMethod>
-
- com.authlete.common.types.ClientAuthMethod
-
- All Implemented Interfaces:
Serializable,Comparable<ClientAuthMethod>
public enum ClientAuthMethod extends Enum<ClientAuthMethod>
Client authentication methods.- Author:
- Takahiko Kawasaki
- See Also:
- OpenID Connect Core 1.0, 9. Client Authentication
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ATTEST_JWT_CLIENT_AUTH"attest_jwt_client_auth"(7).CLIENT_SECRET_BASIC"client_secret_basic"(1).CLIENT_SECRET_JWT"client_secret_jwt"(3).CLIENT_SECRET_POST"client_secret_post"(2).NONE"none"(0).PRIVATE_KEY_JWT"private_key_jwt"(4).SELF_SIGNED_TLS_CLIENT_AUTH"self_signed_tls_client_auth"(6).TLS_CLIENT_AUTH"tls_client_auth"(5).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientAuthMethodgetByValue(short value)Find an instance of this enum by a value.shortgetValue()Get the integer representation of this enum instance.booleanisCertificateBased()Check if this instance represents a certificate-based client authentication method.booleanisJwtBased()Check if this instance represents a JWT-based client authentication method.booleanisSecretBased()Check if this instance represents a client-secret-based client authentication method.static ClientAuthMethodparse(String method)ConvertStringtoClientAuthMethod.static ClientAuthMethod[]toArray(int bits)static inttoBits(EnumSet<ClientAuthMethod> set)static EnumSet<ClientAuthMethod>toSet(int bits)static EnumSet<ClientAuthMethod>toSet(ClientAuthMethod[] array)StringtoString()static ClientAuthMethodvalueOf(String name)Returns the enum constant of this type with the specified name.static ClientAuthMethod[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final ClientAuthMethod NONE
"none"(0).The Client does not authenticate itself at the Token Endpoint, either because it uses only the Implicit Flow (and so does not use the Token Endpoint) or because it is a Public Client with no Client Secret or other authentication mechanism.
-
CLIENT_SECRET_BASIC
public static final ClientAuthMethod CLIENT_SECRET_BASIC
"client_secret_basic"(1).Clients that have received a
client_secretvalue from the Authorization Server authenticate with the Authorization Server in accordance with Section 3.2.1 of OAuth 2.0 [RFC6749] using the HTTP Basic authentication scheme.
-
CLIENT_SECRET_POST
public static final ClientAuthMethod CLIENT_SECRET_POST
"client_secret_post"(2).Clients that have received a
client_secretvalue from the Authorization Server, authenticate with the Authorization Server in accordance with Section 3.2.1 of OAuth 2.0 [RFC6749] by including the Client Credentials in the request body.
-
CLIENT_SECRET_JWT
public static final ClientAuthMethod CLIENT_SECRET_JWT
"client_secret_jwt"(3).Clients that have received a
client_secretvalue from the Authorization Server create a JWT using an HMAC SHA algorithm, such as HMAC SHA-256. The HMAC (Hash-based Message Authentication Code) is calculated using the octets of the UTF-8 representation of theclient_secretas the shared key.The Client authenticates in accordance with JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants [OAuth.JWT] and Assertion Framework for OAuth 2.0 Client Authentication and Authorization Grants [OAuth.Assertions].
-
PRIVATE_KEY_JWT
public static final ClientAuthMethod PRIVATE_KEY_JWT
"private_key_jwt"(4).Clients that have registered a public key sign a JWT using that key. The Client authenticates in accordance with JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants [OAuth.JWT] and Assertion Framework for OAuth 2.0 Client Authentication and Authorization Grants [OAuth.Assertions].
-
TLS_CLIENT_AUTH
public static final ClientAuthMethod TLS_CLIENT_AUTH
"tls_client_auth"(5).Clients authenticate with the Authorization Server using X.509 certificates as defined in "Mutual TLS Profiles for OAuth Clients".
- Since:
- 2.7
-
SELF_SIGNED_TLS_CLIENT_AUTH
public static final ClientAuthMethod SELF_SIGNED_TLS_CLIENT_AUTH
"self_signed_tls_client_auth"(6).Clients authenticate with the Authorization Server using self-signed certificates as defined in "Mutual TLS Profiles for OAuth Clients".
- Since:
- 2.11
-
ATTEST_JWT_CLIENT_AUTH
public static final ClientAuthMethod ATTEST_JWT_CLIENT_AUTH
"attest_jwt_client_auth"(7).OAuth 2.0 Attestation-Based Client Authentication.
- Since:
- 3.74, Authlete 3.0
- See Also:
- OAuth 2.0 Attestation-Based Client Authentication
-
-
Method Detail
-
values
public static ClientAuthMethod[] 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 (ClientAuthMethod c : ClientAuthMethod.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ClientAuthMethod 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.
-
toString
public String toString()
- Overrides:
toStringin classEnum<ClientAuthMethod>
-
getByValue
public static ClientAuthMethod 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 ClientAuthMethod parse(String method)
ConvertStringtoClientAuthMethod.- Parameters:
method- Client authentication method. For example,"client_secret_basic".- Returns:
ClientAuthMethodinstance, ornull.
-
toBits
public static int toBits(EnumSet<ClientAuthMethod> set)
-
toArray
public static ClientAuthMethod[] toArray(int bits)
-
toSet
public static EnumSet<ClientAuthMethod> toSet(int bits)
-
toSet
public static EnumSet<ClientAuthMethod> toSet(ClientAuthMethod[] array)
-
isSecretBased
public boolean isSecretBased()
Check if this instance represents a client-secret-based client authentication method.- Returns:
trueif this instance is eitherCLIENT_SECRET_BASICorCLIENT_SECRET_POST.- Since:
- 2.47
-
isJwtBased
public boolean isJwtBased()
Check if this instance represents a JWT-based client authentication method.- Returns:
trueif this instance is one ofCLIENT_SECRET_JWT,PRIVATE_KEY_JWTorATTEST_JWT_CLIENT_AUTH.- Since:
- 2.47
-
isCertificateBased
public boolean isCertificateBased()
Check if this instance represents a certificate-based client authentication method.- Returns:
trueif this instance is eitherTLS_CLIENT_AUTHorSELF_SIGNED_TLS_CLIENT_AUTH.- Since:
- 2.47
-
-