Is there any way to add external identity providers from database, and show the providers based on the user access?
I can add multiple external identity providers in startup.cs, but I want to load it from DB instead of static values like below
.AddOpenIdConnect("AAD", "Login with Azure AD", options =>
{
options.Authority = "https://login.windows.net/XXXXXXXX";
options.ClientId = "YYYYYYYYYYYYYYYYYYY";
options.ResponseType = "id_token";
options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = false };
options.CallbackPath = "/signin-oidc";
}).AddOpenIdConnect("id", "Login", options =>
{
options.Authority = "https://login.windows.net/ZZZZZZZZZZ";
options.ClientId = "QQQQQQQQQQ";
options.ResponseType = "id_token";
options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = false };
options.CallbackPath = "/signin-oidc";
})
I have seen IIdentityProviderStore, but it was confusing becuase there was no options to set Authority and ClientId.
Thank you in advance!