结合使用AuthToken身份验证和Facebook OAuth身份验证-如何使两者同时工作?

时间:2020-10-27 13:34:21

标签: asp.net-core asp.net-identity

我正在将Facebook身份验证添加到现有的ASP.NET Core应用程序中。我可以任一个工作,但是我不能同时工作。我想念什么?

// startup.cs
services.AddAuthentication(options => 
{
    options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
    // If this next line is commented out, Facebook works but AuthToken doesn't.
    // If this next line is NOT commented out, Facebook stops working and AuthToken works as original.
    options.DefaultAuthenticateScheme = AuthTokenHandler.AuthenticationScheme;
})
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme)
.AddFacebook(FacebookDefaults.AuthenticationScheme, options =>
{
    options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
    // other facebook options ...
})
.AddAuthTokenHandler();

如何获取“常规”身份验证请求以路由到AuthTokenHandler?

0 个答案:

没有答案