Enum Class RestAuthenticationType
- All Implemented Interfaces:
Serializable,Comparable<RestAuthenticationType>,Constable
Defines the supported authentication types for REST service calls.
This enumeration provides all authentication methods that can be used when executing REST API calls from Bonita processes or REST API extensions.
- Since:
- 1.0
- Author:
- Bonitasoft
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAPI Key authentication.HTTP Basic Authentication using username and password.Bearer token authentication (JWT, OAuth2 access tokens).Client Certificate Authentication (mTLS).Custom authentication with user-defined headers.Digest Authentication.No authentication required.NTLM Authentication for Windows-based services.OAuth 2.0 Client Credentials grant type.OAuth 2.0 Resource Owner Password grant type. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<RestAuthenticationType>Finds an authentication type by its key (case-insensitive).Retrieves all authentication types as a read-only Map.Retrieves all technical keys as a read-only List.Gets a brief description of the authentication type.getKey()Gets the technical key of the authentication type.static booleanChecks if a given string corresponds to a valid enum constant.booleanChecks if this authentication type requires credentials (username/password).booleanChecks if this authentication type requires OAuth2 token exchange.booleanChecks if this authentication type uses a static token.static RestAuthenticationTypeReturns the enum constant of this class with the specified name.static RestAuthenticationType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No authentication required. Used for public APIs. -
BASIC
HTTP Basic Authentication using username and password. Credentials are sent as Base64 encoded header: Authorization: Basic base64(user:pass) -
BEARER
Bearer token authentication (JWT, OAuth2 access tokens). Token is sent as header: Authorization: Bearer {token} -
API_KEY
API Key authentication. Key can be sent in header or query parameter. -
OAUTH2_CLIENT_CREDENTIALS
OAuth 2.0 Client Credentials grant type. Used for server-to-server authentication without user context. -
OAUTH2_PASSWORD
OAuth 2.0 Resource Owner Password grant type. Used when username/password are exchanged for tokens (legacy, not recommended). -
DIGEST
Digest Authentication. More secure than Basic as password is never sent in clear text. -
NTLM
NTLM Authentication for Windows-based services. -
CERTIFICATE
Client Certificate Authentication (mTLS). Uses X.509 certificates for mutual TLS authentication. -
CUSTOM
Custom authentication with user-defined headers.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getKey
Gets the technical key of the authentication type.- Returns:
- The technical key (lowercase)
-
getDescription
Gets a brief description of the authentication type.- Returns:
- The description
-
isValid
Checks if a given string corresponds to a valid enum constant.- Parameters:
input- The string to validate (case-insensitive)- Returns:
trueif the string is a valid enum constant
-
fromKey
Finds an authentication type by its key (case-insensitive).- Parameters:
key- The key to search for- Returns:
- Optional containing the matching type, or empty if not found
-
getAllData
Retrieves all authentication types as a read-only Map.- Returns:
- A map containing all authentication data (Key -> Description)
-
getAllKeysList
Retrieves all technical keys as a read-only List.- Returns:
- A list containing all authentication type keys
-
requiresCredentials
public boolean requiresCredentials()Checks if this authentication type requires credentials (username/password).- Returns:
trueif credentials are required
-
requiresOAuth2TokenExchange
public boolean requiresOAuth2TokenExchange()Checks if this authentication type requires OAuth2 token exchange.- Returns:
trueif OAuth2 token exchange is required
-
usesStaticToken
public boolean usesStaticToken()Checks if this authentication type uses a static token.- Returns:
trueif a static token is used
-