Replies: 2 comments 3 replies
-
|
Been investigating a bit - but still stuck. I've come so far that I figured that if I inejct IOptions into my controller endpoint - I can see/investigate the Authentication schemes as AuthenticationSchemeBuilders. All I need to now is just replace or add the "AzureAD" configured scheme. But I have failed to find a way to get help from the Microsoft.Identity.Web framework to build a scheme unless I have the IServiceCollection to start from - which I only have during startup. So cant call AddMicrosoftIdentityWebApi and cant seem to find another extension method that can solve it for me. Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
|
@AnkHansen Did you try the ASP.NET Core hot reload feature? ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
We are extending our existing API to support authenticating with a Azure AD token.
Our customers will/must be able to configure options on their site, and supply TenantId and ClientId and enable/disable AzureAD integration when their users login in to our system.
Once authenticated with Azure token we still use our own JWT tokens as accesstokens, that contain a mapping to the user in our system and the rights granted to them.
The API's run one instance per customer.
So I need to support both the existing JWTBearer authentication and Azurea AD Authentication.
I have it working using Microsoft.Identity.Web and calling AddMicrosoftIdentityWebApi during startup supplying TenantId ,ClientId and Instance from our options. And are in control of how I enable/disable Azure AD as long as the options are set BEFORE the API starts.
My problem is to figure out how (if possible) I can call AddMicrosoftIdentityWebApi on the AuthenticationBuilder in the following scenario.
It's not a very good solution that the API has to be shut down and restarted before the settings take effect.
Ideally, I would call "something" after our Options has been saved, and reconfigure the AuthenticationBuilder from scratch to ensure the current "instance" runs with the correct setup.
My current setup of the Authentication builder is pasted below, which works when API is restarted if Options change.
I hope someone can shine some light on what is possible in a scenario like this.
/Anders
Beta Was this translation helpful? Give feedback.
All reactions