Class AzureWorkloadIdentityAssertionProvider

java.lang.Object
org.cibseven.bpm.client.interceptor.auth.AzureWorkloadIdentityAssertionProvider
All Implemented Interfaces:
ClientAssertionProvider

public class AzureWorkloadIdentityAssertionProvider extends Object implements ClientAssertionProvider

Supplies a federated identity token for Azure Workload Identity authentication.

Azure Workload Identity injects a file containing a short-lived service account token (signed by the Kubernetes OIDC issuer) into the workload pod. This token can be exchanged for an Azure Entra ID access token via the urn:ietf:params:oauth:client-assertion-type:jwt-bearer mechanism.

The file path is read from the AZURE_FEDERATED_TOKEN_FILE environment variable, which is injected automatically by the Azure Workload Identity mutating webhook. The file is re-read on every getAssertion() call because Azure rotates the token periodically.

Required environment variable:

  • AZURE_FEDERATED_TOKEN_FILE — absolute path to the projected token file (e.g. /var/run/secrets/azure/tokens/azure-identity-token)
  • Field Details

  • Constructor Details

    • AzureWorkloadIdentityAssertionProvider

      public AzureWorkloadIdentityAssertionProvider()
  • Method Details

    • getAssertion

      public String getAssertion()
      Reads and returns the federated identity token from the file path referenced by the AZURE_FEDERATED_TOKEN_FILE environment variable.

      The file is read fresh on every call because Azure Workload Identity rotates the token file automatically.

      Specified by:
      getAssertion in interface ClientAssertionProvider
      Returns:
      the raw federated token string (used directly as client_assertion)
      Throws:
      ExternalTaskClientException - if the environment variable is not set or the file cannot be read