The url you pass to AcquireTokenForManagedIdentity() is not valid.
ManagedIdentityApplication.AcquireTokenForManagedIdentity("api://AzureADTokenExchange") giving error in local machine.
SivaD
0
Reputation points Microsoft Vendor
Hi,
I am implementing the "Federated Identity Credential" along with User Managed identity in .net core 3.1 web api.
Getting the error code: "managed_identity_unreachable_network" with error message "A socket operation was attempted to an unreachable network." in local machine in visual studio. Please suggest the solution for the below code.
IManagedIdentityApplication mi = ManagedIdentityApplicationBuilder.Create(ManagedIdentityId.WithUserAssignedClientId(userAssignedMSI)).Build();
AuthenticationResult assertion= await mi.AcquireTokenForManagedIdentity("api://AzureADTokenExchange/.default").ExecuteAsync().ConfigureAwait(false);
Thank you,
Siva