Microsoft Entra Workload ID
Security

Flexible federated identity credentials (preview)

In brief

The guidance now covers applications and user-assigned managed identities, including Azure Resource Manager setup instructions and updated GitLab claim-matching requirements.

What Entra admins need to know

Managed identity administrators can use the updated guidance when configuring these credentials. No action is required.

This editorial summary was generated by AI from the documentation changes. Verify important details in the full Microsoft Learn article.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Flexible federated identity credentials (preview)

How do flexible federated identity credentials work?

Flexible federated identity credentials don't change the baseline functionality provided by federated identity credentials. These trust relationships are still used to indicate which token from the external IdP should be trusted by your application.application or user-assigned managed identity. Instead, they extend the ability of federated identity credentials by enabling scenarios which previously required multiple federated identity credentials to instead be managed under a single flexible federated identity credential. A few examples include:

  • GitHub repositories with various workflows, each running on a different branch (or being used across branches). Previously, a unique federated identity credential was required for each of the branches in which workflows could run across. With flexible federated identity credentials, this scenario can be managed under a single federated identity credential.
  • Terraform cloudCloud run_phases plans, which each requires a unique federated identity credential. With flexible federated identity credentials, this can be managed under a single flexible federated identity credential.
  • Reusable GitHub Actions workflows, where wildcards can be used against GitHub's custom job_workflow_ref claim.

Supported identity resources

Flexible federated identity credentials are supported for applications and user-assigned managed identities.

Flexible federated identity credential language structure

"claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'"


## Flexible federated identity credential expression language functionality

Flexible federated identity credentials currently support the use of a few operators across the enabled issuers. Single quotes are interpreted as escape characters within the flexible federated identity credential expression language.

Depending on the platform you're using, you need to implement different issuer URLs, claims, and operators. Use the following tabs to select your chosen platform.

### [GitHub](#tab/github)

Supported issuer URLs: `https://token.actions.githubusercontent.com`


Supported issuer URLs: `https://gitlab.com`, `https://gitlab.example.com`, and `https://gitlab.example.ca` where `example` can be any string.

When you use mutable subjects with GitLab, your flexible federated identity credential expression must match the `sub` and `project_id` claims.

Supported claims and operators per claim:

- Claim `sub` supports operators `eq` and `matches`.
- Claim `project_id` supports operator `eq`.

### [Terraform Cloud](#tab/terraformcloud)


You can use Azure CLI's `az rest` method to make REST API requests for flexible federated identity credential creation and management.

### Application

```bash
az rest --method post \
    --url https://graph.microsoft.com/beta/applications/{objectId}/federatedIdentityCredentials
    --body "{'name': 'FlexFic1', 'issuer': 'https://token.actions.githubusercontent.com', 'audiences': ['api://AzureADTokenExchange'], 'claimsMatchingExpression': {'value': 'claims[\'sub\'] matches \'repo:contoso/contoso-repo:ref:refs/heads/*\' and claims[\'repository_id\'] eq \'456789\'', 'languageVersion': 1}}"

User-assigned managed identity

Use the Azure Resource Manager federated identity credential resource for a user-assigned managed identity.

az rest --method put \
    --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}/federatedIdentityCredentials/{credentialName}?api-version=2025-01-31-preview" \
    --body "{'properties': {'issuer': 'https://token.actions.githubusercontent.com', 'audiences': ['api://AzureADTokenExchange'], 'claimsMatchingExpression': {'value': 'claims[\'sub\'] matches \'repo:contoso/contoso-repo:ref:refs/heads/*\' and claims[\'repository_id\'] eq \'456789\'', 'languageVersion': 1}}}"

Flexible federated identity credential properties

  • audiences: The audience that can appear in the external token. This field is mandatory and should be set to api://AzureADTokenExchange for Microsoft Entra ID. It says what Microsoft identity platform should accept in the aud claim in the incoming token. This value represents Microsoft Entra ID in your external identity provider and has no fixed value across identity providers - you might need to create a new application registration in your IdP to serve as the audience of this token.
  • issuer: The URL of the external identity provider. Must match the issuer claim of the external token being exchanged.
  • subject: The identifier of the external software workload within the external identity provider. Like the audience value, it has no fixed format, as each IdP uses their own - sometimes a GUID, sometimes a colon delimited identifier, sometimes arbitrary strings. The value here must match the sub claim within the token presented to Microsoft Entra ID. If subject is defined, claimsMatchingExpression must be set to null.
  • name: A unique string to identify the credential. For applications, this property is an alternate key, and you can use it to reference the credential through the GET and UPSERT operations. For a user-assigned managed identity, the credential name is part of the Azure Resource Manager resource path.
  • claimsMatchingExpression: a new complex type containing two properties, value and languageVersion. Value is used to define the expression, and languageVersion is used to define the version of the flexible federated identity credential expression language (FFL) being used. languageVersion should always be set to 1. If claimsMatchingExpression is defined, subject must be set to null.

For an application, these properties are part of the Microsoft Graph federatedIdentityCredentials resource. For a user-assigned managed identity, Azure Resource Manager accepts and returns the properties through the Microsoft.ManagedIdentity federated identity credential resource.

Related content

Daily Entra.News

Get daily email updates

Get a concise summary of the latest Microsoft Entra updates delivered straight to your inbox.

Loading the secure signup form…