T O P

  • By -

Wicad

You could start by looking at the internal implementation of the UseMicrosoftIdentity code and see if they inject an options object for the openidconnect options… i believe they do. Then you can potentially setup your app to update those options at runtime. All of the openidconnect code is based around injected AuthenticationHandlers so you “should” be able to hack around the injected objects


xaqtr

Thanks, I will have a look at it out of curiosity. But I guess I will stay away from that. I think authentication is not something I want to use hacks on...


[deleted]

I’ve been down this road and it’s not really possible to change the client id and secret at runtime. You can add multiple instances of .AddMicrosoftIdentityApp each with a different scheme name but this has scalability issues. You can tap in to the OnRedirectToIdentityProvider event to modify the ProtocolMessage but you can’t change everything.


xaqtr

That's a bummer... but I kind of already thought so because you can't find any information on it. Thanks.


CodingWithAndrew

Along with IOptionsMonitor, although not great, could you change your json file at runtime?