Enum Class RestAuthenticationType

java.lang.Object
java.lang.Enum<RestAuthenticationType>
com.bonitasoft.processbuilder.enums.RestAuthenticationType
All Implemented Interfaces:
Serializable, Comparable<RestAuthenticationType>, Constable

public enum RestAuthenticationType extends Enum<RestAuthenticationType>
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
  • Enum Constant Details

    • NONE

      public static final RestAuthenticationType NONE
      No authentication required. Used for public APIs.
    • BASIC

      public static final RestAuthenticationType BASIC
      HTTP Basic Authentication using username and password. Credentials are sent as Base64 encoded header: Authorization: Basic base64(user:pass)
    • BEARER

      public static final RestAuthenticationType BEARER
      Bearer token authentication (JWT, OAuth2 access tokens). Token is sent as header: Authorization: Bearer {token}
    • API_KEY

      public static final RestAuthenticationType API_KEY
      API Key authentication. Key can be sent in header or query parameter.
    • OAUTH2_CLIENT_CREDENTIALS

      public static final RestAuthenticationType OAUTH2_CLIENT_CREDENTIALS
      OAuth 2.0 Client Credentials grant type. Used for server-to-server authentication without user context.
    • OAUTH2_PASSWORD

      public static final RestAuthenticationType OAUTH2_PASSWORD
      OAuth 2.0 Resource Owner Password grant type. Used when username/password are exchanged for tokens (legacy, not recommended).
    • DIGEST

      public static final RestAuthenticationType DIGEST
      Digest Authentication. More secure than Basic as password is never sent in clear text.
    • NTLM

      public static final RestAuthenticationType NTLM
      NTLM Authentication for Windows-based services.
    • CERTIFICATE

      public static final RestAuthenticationType CERTIFICATE
      Client Certificate Authentication (mTLS). Uses X.509 certificates for mutual TLS authentication.
    • CUSTOM

      public static final RestAuthenticationType CUSTOM
      Custom authentication with user-defined headers.
  • Method Details

    • values

      public static RestAuthenticationType[] 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

      public static RestAuthenticationType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getKey

      public String getKey()
      Gets the technical key of the authentication type.
      Returns:
      The technical key (lowercase)
    • getDescription

      public String getDescription()
      Gets a brief description of the authentication type.
      Returns:
      The description
    • isValid

      public static boolean isValid(String input)
      Checks if a given string corresponds to a valid enum constant.
      Parameters:
      input - The string to validate (case-insensitive)
      Returns:
      true if the string is a valid enum constant
    • fromKey

      public static Optional<RestAuthenticationType> fromKey(String key)
      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

      public static Map<String,String> getAllData()
      Retrieves all authentication types as a read-only Map.
      Returns:
      A map containing all authentication data (Key -> Description)
    • getAllKeysList

      public static List<String> 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:
      true if credentials are required
    • requiresOAuth2TokenExchange

      public boolean requiresOAuth2TokenExchange()
      Checks if this authentication type requires OAuth2 token exchange.
      Returns:
      true if OAuth2 token exchange is required
    • usesStaticToken

      public boolean usesStaticToken()
      Checks if this authentication type uses a static token.
      Returns:
      true if a static token is used