I have an application with several tenants that allows each tenant to have their own subdomain / user domain and authentication. In this application I use OpenIdConnectAuthentication, can I make the administrator dynamic (for example, when the tenant has a subdomain tenant1.mysite.com or a tenant1.com own domain - the authorization address will be login.tenant1.mysite.com or login. Tenant1.com).
var oidcOptions = new OpenIdConnectOptions
{
AuthenticationScheme = "oidc",
SignInScheme = "Cookies",
Authority = *dynamic*,
RequireHttpsMetadata = false,
PostLogoutRedirectUri = *dynamic*,
ClientId = "clientID",
ClientSecret = "clientSecret",
ResponseType = "code id_token",
GetClaimsFromUserInfoEndpoint = true,
SaveTokens = true
};
I had the thought of the possibility of creating middleware to override the constructor for UseOpenIdConnectAuthentication, but this did not work, and now I have no ideas.