I'm using .NET 4.6 with OWIN Context to configure app security. The app supports multiple identity providers, which I'm adding in the Startup.Auth.cs file like this:
private static void AddOidcProviders(IAppBuilder app, IEnumerable<IdentityProviderDetails> allProviders)
{
var oidcProviders = allProviders.Where(x => x.ProviderType == IdpProvidersConstants.OpenIdConnect);
foreach (var oidcProvider in oidcProviders)
{
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
//provider specific config
});
}
}
The problem with the code above is that it runs only once - during the app start-up. Since I keep those providers details in the database, they can change unexpectedly. Is it possible to add more providers and/or update existing ones without restarting the app pool? I've tried injecting AppBuilder to HomeController and re run the AddOidcProviders, but the providers details are not updated.