Im using the Microsoft Identity Web package latest (2.6.2) in .NET Core 7.0 to secure my front end app, which in turn calls a down stream api (API Gateway)
In order to call the downstream API, we have to configure a client secret which is stored in the client's App Registration in Azure.
Currently the "ClientSecret" could be stored in either the apps local settings (during dev) or the secrets.json file. I understand others have chosen to store the secret in Azure Key Vault, or possibly using an X509 cert instead which can achieve longer expiry time.
I'm actually in the process of migrating away using from connections strings/keys to using Azure Managed Identities to connect with the different services, for the simple reason of eliminating the challenge in key rotation which in a production environment just adds more pain.
Question - Even if not currently available, is Azure planning to extend the use of Azure Managed Identities as an option to eliminate the use of client secrets and the laborious secret key rotation process in App Registrations? Using Azure vault is all well and good but it doesnt solve the challenge for keys that evetually expire and need to be rotated, the onyly added value I see is the emans to remove the secret from the apps'code...
I'm looking a solution like the example below (which may not currently exisit)
// Using DefaultAzureCredential() instead of a client secret
// ---------------------------------------------------------
builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"))
.EnableTokenAcquisitionToCallDownstreamApi(new DefaultAzureCredential())
.AddMicrosoftGraph(builder.Configuration.GetSection("GraphBeta"))
.AddInMemoryTokenCaches();
If this is never going to happen, then one other options might be fetching the clinet secret from Azure Key Vault, the secret itself would ideally need to have an expiry longer than the current maximum 2 years.
I'm not sure if its possible to extend the expiry of the secret, Azure used to allow this as I'm still using one during development that was set to expire 12/31/2299.