Set up a Flexible Federated identity credential (preview)
In brief
The documentation now explains setup for applications and user-assigned managed identities, using Microsoft Graph for applications and Azure Resource Manager for managed identities. It also adds details about credential properties, including claimsMatchingExpression.
What Entra admins need to know
Administrators managing user-assigned managed identities can use the new setup guidance. 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.
Set up a Flexible Federated identity credential (preview)
This article shows how to configureset up a flexible federated identity credential for an application inor user-assigned managed identity. You can use the Azure portal orportal, Microsoft Graph Explorer. Usefor an application, or Azure Resource Manager for a user-assigned managed identity. Before you begin, review the issuer-specific examples to create a credential for GitHub, GitLab, or Terraform Cloud.requirements in Prerequisites.
Prerequisites
- An Azure account with an active subscription. If you don't already have one, Create an account for free.
- For an application, create an app registration. Grant
your appthe application access to the Azure resources targeted by your external software workload. - For a managed identity, create a user-assigned managed identity.
Setting up federated identity credentials through Microsoft GraphUnderstand the credential properties
To accommodate the flexible federated identity credential functionality, the federatedIdentityCredentials resource is being extended with a new claimsMatchingExpression property. In addition to this, the subject property is now nullable. The claimsMatchingExpression and subject properties have been made mutually exclusive, so you can't define both within a federated identity credential.
Property Description audiences :The audience that can appear in the external token. This field is mandatory and should be set to api://AzureADTokenExchangefor Microsoft Entra ID. It says what Microsoft identity platform should accept in theaudclaim 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 issuerclaim 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 subclaim within the token presented to Microsoft Entra ID. Ifsubjectis defined,claimsMatchingExpressionmust be set to null.name :A unique string to identify the credential. ThisFor applications, this property is an alternatekeykey, andthe valueyou canbe useduse it to reference thefederated identitycredentialviathrough a GET operation. For a user-assigned managed identity, theGET and UPSERT operations.credential name is part of the Azure Resource Manager resource path.claimsMatchingExpression :a new complex type containing two properties, valueandlanguageVersion.languageVersion. Value is used to define the expression, andlanguageVersionis used to define the version of the flexible federated identity credential expression language (FFL) being used.languageVersionshould always be set to 1. IfclaimsMatchingExpressionis defined,subjectmust be set to null.Set up a
Flexible Federatedflexible federated identity credentialFor GitHub, a flexible federated identity credential must match the
subclaim and one or both of the following immutable claims:These claims are required regardless of whether
subuses a name-based, customized, or immutable format.When you use mutable subjects with GitLab, your flexible federated identity credential expression must match the
subandproject_idclaims.Azure portalApplication - Azure portalTo create the credential in the Azure portal:
- Navigate to Microsoft Entra ID and select the application where you want to configure the federated identity credential.
- In the left-hand navigation pane, select Certificates & secrets.
- Under the Federated credentials tab, select + Add credential.
- In the Add a credential window that appears, from the dropdown menu next to Federated credential scenario, select Other issuer.
- Under Connect your account, enter the Issuer URL of the external identity provider. For example:
- GitHub:
https://token.actions.githubusercontent.com - GitLab:
https://gitlab.example.com - Terraform Cloud:
https://app.terraform.io
- GitHub:
- In Value, enter the claim matching expression you want to use. For example, for GitHub, enter
claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'. - Select Add to save the credential.
Microsoft Graph ExplorerApplication - Microsoft Graph
To create the credential by using Microsoft Graph Explorer:
Open the Microsoft Graph Explorer.
In the Request section, enter the URL that corresponds to the application:
https://graph.microsoft.com/beta/applications/{objectId}/federatedIdentityCredentials.Add the following request body:
{ "audiences": [ "api://AzureADTokenExchange" ], "issuer": "https://token.actions.githubusercontent.com", "name": "MyFlexibleFIC", "claimsMatchingExpression": { "value": "claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'", "languageVersion": 1 } }Select Run query to create the federated identity credential.
Managed identity - Azure portal
To create the credential for a user-assigned managed identity in the Azure portal:
- In the Azure portal, open the user-assigned managed identity where you want to configure the credential.
- Under Settings, select Federated credentials.
- Select Add credential.
- For Federated credential scenario, select Other issuer.
- Enter the Issuer URL of the external identity provider. For example:
- GitHub:
https://token.actions.githubusercontent.com - GitLab:
https://gitlab.example.com - Terraform Cloud:
https://app.terraform.io
- GitHub:
- In Value, enter the claims matching expression. For example, enter
claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'. - Select Add to save the credential.
Managed identity - ARM REST
Create the credential under the user-assigned managed identity's Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials resource.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}/federatedIdentityCredentials/{credentialName}?api-version=2025-01-31-preview
Content-Type: application/json
{
"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
}
}
}
The request must contain either subject or claimsMatchingExpression, but not both.
More examples of Flexible Federated identity credentials
GitLab
Get the numeric project_id value from the GitLab ID token. Include this immutable claim when the sub claim uses the mutable project_path format.
{
"audiences": [
"name": "MyGitLabFlexibleFIC",
"issuer": "https://gitlab.example.com",
"claimsMatchingExpression": {
"value": "claims['sub'] matches 'project_path:contoso/contoso-project:ref_type:branch:ref:main' and claims['project_id'] eq '57382910'",
"languageVersion": 1
}
}
### [Terraform Cloud](#tab/terraform-cloud)
The following example matches Terraform Cloud runs for any run phase in the specified workspace:
```json
{
"audiences": [
@@ -1,38 +1,35 @@ --- title: Set up a Flexible Federated identity credential (preview)-description: Learn how to configure a Microsoft Entra Workload ID flexible federated identity credential by using the Azure portal or Microsoft Graph.+description: Learn how to configure a flexible federated identity credential for an application or user-assigned managed identity by using the Azure portal or REST APIs. ms.topic: how-to-ms.date: 08/14/2026+ms.date: 09/18/2026 ms.custom: msecd-doc-authoring-1018 ms.reviewer: ludwignick ai-usage: ai-assisted-#customer intent: As an application administrator, I want to configure a flexible federated identity credential so that external workloads can authenticate with Microsoft Entra ID.+#customer intent: As an application or managed identity administrator, I want to configure a flexible federated identity credential so that an external workload can authenticate with Microsoft Entra ID. --- # Set up a Flexible Federated identity credential (preview) -This article shows how to configure a [flexible federated identity credential](workload-identities-flexible-federated-identity-credentials.md) for an application in the Azure portal or Microsoft Graph Explorer. Use the issuer-specific examples to create a credential for GitHub, GitLab, or Terraform Cloud.+This article shows how to set up a [flexible federated identity credential](workload-identities-flexible-federated-identity-credentials.md) for an application or user-assigned managed identity. You can use the Azure portal, Microsoft Graph for an application, or Azure Resource Manager for a user-assigned managed identity. Before you begin, review the requirements in [Prerequisites](#prerequisites). ## Prerequisites - An Azure account with an active subscription. If you don't already have one, [Create an account for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).-- [Create an app registration](~/identity-platform/quickstart-register-app.md). Grant your app access to the Azure resources targeted by your external software workload.+- For an application, [create an app registration](~/identity-platform/quickstart-register-app.md). Grant the application access to the Azure resources targeted by your external software workload.+- For a managed identity, [create a user-assigned managed identity](~/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md). -> [!NOTE]-> -> Flexible federated identity credentials support is not yet available for [managed identities](/entra/identity/managed-identities-azure-resources/overview).+## Understand the credential properties -## Setting up federated identity credentials through Microsoft Graph+| **Property** | **Description** |+| --- | --- |+| **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 a GET operation. 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. | -To accommodate the flexible federated identity credential functionality, the `federatedIdentityCredentials` resource is being extended with a new `claimsMatchingExpression` property. In addition to this, the `subject` property is now nullable. The `claimsMatchingExpression` and `subject` properties have been made mutually exclusive, so you can't define both within a federated identity credential.--- `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. This property is an alternate key and the value can be used to reference the federated identity credential via the [GET](/graph/api/federatedidentitycredential-get) and [UPSERT](/graph/api/federatedidentitycredential-upsert) operations. -- `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. --## Set up a Flexible Federated identity credential+## Set up a flexible federated identity credential For GitHub, a flexible federated identity credential must match the `sub` claim and one or both of the following immutable claims: @@ -41,44 +38,86 @@ For GitHub, a flexible federated identity credential must match the `sub` claim These claims are required regardless of whether `sub` uses a name-based, customized, or immutable format. -### [Azure portal](#tab/azure-portal)+When you use mutable subjects with GitLab, your flexible federated identity credential expression must match the `sub` and `project_id` claims.++### [Application - Azure portal](#tab/application-portal) To create the credential in the Azure portal: -1. Navigate to Microsoft Entra ID and select the application where you want to configure the federated identity credential.-1. In the left-hand navigation pane, select **Certificates & secrets**.-1. Under the **Federated credentials** tab, select **+ Add credential**.-1. In the **Add a credential** window that appears, from the dropdown menu next to **Federated credential scenario**, select **Other issuer**.-1. Under **Connect your account**, enter the **Issuer** URL of the external identity provider. For example:- - GitHub: `https://token.actions.githubusercontent.com`- - GitLab: `https://gitlab.example.com`- - Terraform Cloud: `https://app.terraform.io`-1. In **Value**, enter the claim matching expression you want to use. For example, for GitHub, enter `claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'`.-1. Select **Add** to save the credential.+- Navigate to Microsoft Entra ID and select the application where you want to configure the federated identity credential.+- In the left-hand navigation pane, select **Certificates & secrets**.+- Under the **Federated credentials** tab, select **+ Add credential**.+- In the **Add a credential** window that appears, from the dropdown menu next to **Federated credential scenario**, select **Other issuer**.+- Under **Connect your account**, enter the **Issuer** URL of the external identity provider. For example:+ - GitHub: `https://token.actions.githubusercontent.com`+ - GitLab: `https://gitlab.example.com`+ - Terraform Cloud: `https://app.terraform.io`+- In **Value**, enter the claim matching expression you want to use. For example, for GitHub, enter `claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'`.+- Select **Add** to save the credential. -### [Microsoft Graph Explorer](#tab/graph-explorer)+### [Application - Microsoft Graph](#tab/application-graph) To create the credential by using Microsoft Graph Explorer: -1. Open the [Microsoft Graph Explorer](https://developer.microsoft.com/graph/graph-explorer).-1. In the **Request** section, enter the URL that corresponds to the application: `https://graph.microsoft.com/beta/applications/{objectId}/federatedIdentityCredentials`.-1. Add the following request body:-- ```json- {- "audiences": [- "api://AzureADTokenExchange"- ],- "issuer": "https://token.actions.githubusercontent.com",- "name": "MyFlexibleFIC",- "claimsMatchingExpression": {- "value": "claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'",- "languageVersion": 1- }+- Open the [Microsoft Graph Explorer](https://developer.microsoft.com/graph/graph-explorer).+- In the **Request** section, enter the URL that corresponds to the application: `https://graph.microsoft.com/beta/applications/{objectId}/federatedIdentityCredentials`.+- Add the following request body:++ ```json+ {+ "audiences": [+ "api://AzureADTokenExchange"+ ],+ "issuer": "https://token.actions.githubusercontent.com",+ "name": "MyFlexibleFIC",+ "claimsMatchingExpression": {+ "value": "claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'",+ "languageVersion": 1+ }+ }+ ```++- Select **Run query** to create the federated identity credential.++### [Managed identity - Azure portal](#tab/managed-identity-portal)++To create the credential for a user-assigned managed identity in the Azure portal:++- In the [Azure portal](https://portal.azure.com), open the user-assigned managed identity where you want to configure the credential.+- Under **Settings**, select **Federated credentials**.+- Select **Add credential**.+- For **Federated credential scenario**, select **Other issuer**.+- Enter the **Issuer** URL of the external identity provider. For example:+ - GitHub: `https://token.actions.githubusercontent.com`+ - GitLab: `https://gitlab.example.com`+ - Terraform Cloud: `https://app.terraform.io`+- In **Value**, enter the claims matching expression. For example, enter `claims['sub'] matches 'repo:contoso/contoso-repo:ref:refs/heads/*' and claims['repository_id'] eq '456789'`.+- Select **Add** to save the credential.++### [Managed identity - ARM REST](#tab/managed-identity-rest)++Create the credential under the user-assigned managed identity's `Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials` resource.++```http+PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}/federatedIdentityCredentials/{credentialName}?api-version=2025-01-31-preview+Content-Type: application/json++{+ "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 }- ```+ }+}+```++The request must contain either `subject` or `claimsMatchingExpression`, but not both. -1. Select **Run query** to create the federated identity credential. --- ## More examples of Flexible Federated identity credentials@@ -121,6 +160,8 @@ To require the repository to remain with a specific owner, also match `repositor ### [GitLab](#tab/gitlab) +Get the numeric `project_id` value from the GitLab ID token. Include this immutable claim when the `sub` claim uses the mutable `project_path` format.+ ```json { "audiences": [@@ -129,7 +170,7 @@ To require the repository to remain with a specific owner, also match `repositor "name": "MyGitLabFlexibleFIC", "issuer": "https://gitlab.example.com", "claimsMatchingExpression": {- "value": "claims['sub'] matches 'project_path:contoso/contoso-project:ref_type:branch:ref:main'",+ "value": "claims['sub'] matches 'project_path:contoso/contoso-project:ref_type:branch:ref:main' and claims['project_id'] eq '57382910'", "languageVersion": 1 } }@@ -137,6 +178,8 @@ To require the repository to remain with a specific owner, also match `repositor ### [Terraform Cloud](#tab/terraform-cloud) +The following example matches Terraform Cloud runs for any run phase in the specified workspace:+ ```json { "audiences": [ 