Skip to content

arsenvlad/entra-cross-tenant-app-fic-managed-identity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Entra Cross-Tenant Application Federated Identity Credential (FIC)

Experimenting with Entra cross-tenant application Federated Identity Credential trust to Managed Identity

Public Preview announcement blog December 2024 https://devblogs.microsoft.com/identity/access-cloud-resources-across-tenants-without-secrets

Public Preview documentation https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-config-app-trust-managed-identity

My video walking through this experiment Entra corss-tenant secret-free trust using Managed Identity as Federated Identity Credential on multi-tenant app registration

Scenarios

Diagram 1

Diagram 2

Diagram 3

Create resources for testing

Create VM to use for testing

az group create --name rg-entra-fic --location eastus2
az vm create --resource-group rg-entra-fic --name vm-entra-fic --image Ubuntu2404 --admin-username azureuser --size Standard_D2ds_v5 --generate-ssh-keys

Create user assigned managed identity and assign it to the VM

az identity create --resource-group rg-entra-fic --name uami-entra-fic
uamiPrincipalId=$(az identity show --resource-group rg-entra-fic --name uami-entra-fic -o json --query principalId --output tsv)
echo $uamiPrincipalId
az vm identity assign --resource-group rg-entra-fic --name vm-entra-fic --identities uami-entra-fic

SSH into the VM and get managed identity access token for ARM and separately for credentials exchange

ssh azureuser@52.138.98.49 -i ~/.ssh/id_rsa
curl 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2023-11-15&resource=https://management.azure.com/' -H Metadata:true | jq

Create new multi-tenant Entra application registration and service principal

az ad app create --display-name app-entra-fic --sign-in-audience AzureADMultipleOrgs
az ad sp create --id 615ec85d-787d-4107-b4e6-d0a10bdbb28b

Create federated identity credential on the application

az ad app federated-credential create --id 615ec85d-787d-4107-b4e6-d0a10bdbb28b --parameters fic-settings.json
az ad app federated-credential list --id 615ec85d-787d-4107-b4e6-d0a10bdbb28b -o json

SSH into the VM and get managed identity access token for credentials exchange

curl 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2023-11-15&resource=api://AzureADTokenExchange' -H Metadata:true | jq

Decoded in https://jwt.ms

Decoded

Review Failure Modes

As of December 23, 2024, the documentation lists the limitation of having AAD-issued FIC on managed identities https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation#supported-scenarios

Not Supported

Example error message that we were getting previously (see old video from February 2022) Error message from 2022

About

Experimenting with Entra cross-tenant application Federated Identity Credential trust to Managed Identity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages