Enum Class AuthMechanism

java.lang.Object
java.lang.Enum<AuthMechanism>
co.ankatech.ankasecure.sdk.auth.AuthMechanism
All Implemented Interfaces:
Serializable, Comparable<AuthMechanism>, Constable

public enum AuthMechanism extends Enum<AuthMechanism>
The credential kind a TokenSource presents at the ANKASecure token endpoint.

This is a diagnostic, not a switch. Nothing in the SDK's operational path branches on it and no consumer selects it: which mechanism applies is decided by the deployment's configuration and resolved once by TokenSourceChain. It exists so an operator can be told which link of the chain answered, because "authentication failed" is a much worse report than "authentication failed using the external token file at /etc/anka/token".

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    An externally minted token - issued by Auth0, Entra, Okta, Keycloak, Cognito or any other OAuth 2.0 / OIDC authorization server the deployment trusts - presented as a client_assertion under the federated assertion type.
    RFC 6749 §4.4 client credentials: an ANKASecure-issued client_secret posted with grant_type=client_credentials.
    RFC 7523 §2.2 private-key JWT: an assertion this process signs with a key pair whose public half the platform holds.
    No credential at all: an ANKASecure access token the caller obtained elsewhere and handed to the SDK.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static AuthMechanism[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • NATIVE_CLIENT_SECRET

      public static final AuthMechanism NATIVE_CLIENT_SECRET
      RFC 6749 §4.4 client credentials: an ANKASecure-issued client_secret posted with grant_type=client_credentials.
    • PRIVATE_KEY_JWT

      public static final AuthMechanism PRIVATE_KEY_JWT
      RFC 7523 §2.2 private-key JWT: an assertion this process signs with a key pair whose public half the platform holds. The private key never leaves the caller.
    • FEDERATED_ASSERTION

      public static final AuthMechanism FEDERATED_ASSERTION
      An externally minted token - issued by Auth0, Entra, Okta, Keycloak, Cognito or any other OAuth 2.0 / OIDC authorization server the deployment trusts - presented as a client_assertion under the federated assertion type.

      Where that token comes from is not part of this mechanism and is not visible here. The workload may already hold it - read from a value, a file or a command - or the SDK may have obtained it, by performing the client-credentials grant against the workload's own issuer with the workload's own secret. Either way what reaches ANKASecure is one externally minted token carried across one hop, and the platform still holds no credential at any external authorization server: server-side, the only thing it ever fetches from one is a JWKS.

    • SUPPLIED_TOKEN

      public static final AuthMechanism SUPPLIED_TOKEN
      No credential at all: an ANKASecure access token the caller obtained elsewhere and handed to the SDK. It takes no part in the resolution chain, because there is nothing here to resolve.
  • Method Details

    • values

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