Class AzureWorkloadIdentityAssertionProvider
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReads and returns the federated identity token from the file path referenced by theAZURE_FEDERATED_TOKEN_FILEenvironment variable.
-
Field Details
-
ENV_FEDERATED_TOKEN_FILE
- See Also:
-
-
Constructor Details
-
AzureWorkloadIdentityAssertionProvider
public AzureWorkloadIdentityAssertionProvider()
-
-
Method Details
-
getAssertion
Reads and returns the federated identity token from the file path referenced by theAZURE_FEDERATED_TOKEN_FILEenvironment variable.The file is read fresh on every call because Azure Workload Identity rotates the token file automatically.
- Specified by:
getAssertionin interfaceClientAssertionProvider- 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
-