aspnet / Security

[Archived] Middleware for security and authorization of web apps. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.27k stars 600 forks source link

Question: Is it possible to update OpenIdConnectOptions at runtime? #1889

Closed AdamRiddick closed 5 years ago

AdamRiddick commented 5 years ago

Hi,

We have a situation where the values passed into OpenIdConnectOptions are user configurable, as we have multiple providers.

This works great when configuring the options on startup with AddOpenIdConnect(), but we have the situation where the configuration has been changed and requires updating, or a new configuration needs adding.

Is it possible to add new providers, or update an existing provider, at runtime? I haven't been able to find any documentation on this.

Thanks.

Tratcher commented 5 years ago

Yes, see the sample at https://github.com/aspnet/AuthSamples/tree/master/samples/DynamicSchemes for adding and removing schemes.

AdamRiddick commented 5 years ago

Perfect - Thank you.