我正在将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?