Workaround with Configuration Section AzureAD
See original GitHub issueHi all,
when using Microsoft.Identity.Web we usually inject all the necessary configuration with the following code:
services.AddMicrosoftIdentityWebAppAuthentication(Configuration, "AzureAd");
This works as long as a applicationConfig.json file is present.
If I publish my solution as an Azure Web Application I don´t want to use the applicationConfig.json file but rather the environment variables of the Web Application or KeyVault for storing secrets. Sadly the function AddMicrosoftIdentityWebAppAuthentication
does not support this.
Is there a possiblity to not having the “AzureAD” section present or the read all the necessary information from env variables and KeyVault, build the configurationObject by myself and then load it into the method?
Any help would be highly appreciated!
Thanks a lot!
Tom
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top GitHub Comments
It does work this way:
@jmprieur I was confused about having to pass to
AddMicrosoftIdentityWebApi
something forconfigureJwtBearerOptions
(doing nothing) in addition toconfigureMicrosoftIdentityOptions
whereasAddMicrosoftIdentityWebApp
takes onlyconfigureMicrosoftIdentityOptions
which is enough.@spotnick The way to do is to use
AddAuthentication
followed by a different override ofAddMicrosoftIdentityWebApp
which takes delegates: