我一直在尝试使用Open ID Connect(.Net Core的Auth0 quick start sample)。我有一个用例,有时我仍然想使用默认的身份提供程序方案“ Identity.Application”登录到网站。我可以使用OpenIdConnect或Auth0或默认身份来配置我的startup.cs类。
使用OpenIdConnect要求我使用CookieAuthenticationDefaults方案:
.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
使用默认方案:
.AddAuthentication()
我是否可以同时允许这两种方案,以便我可以使用其中任何一种登录?
我认为我将需要在运行时交换中间件,但不知道那是否有可能。