GetExternalLoginInfoAsync
全部标签 我有ASP.NET5项目,我正在使用WebAPI建立外部登录(用于Facebook和Google)。就我而言,我有包含以下代码的WebAPIController(不是MVCController):[OverrideAuthentication][HostAuthentication(DefaultAuthenticationTypes.ExternalCookie)][AllowAnonymous][Route("ExternalLogin",Name="ExternalLogin")]publicasyncTaskGetExternalLogin(stringprovider,str
我创建了一个新的MVC5Web应用程序,当我尝试使用Google或Facebook登录时,调用了AccountController中的ExternalLoginCallback操作,但是GetExternalLoginInfoAsync()始终返回null:varloginInfo=awaitAuthenticationManager.GetExternalLoginInfoAsync();if(loginInfo==null){returnRedirectToAction("Login");}因为它始终为空,所以它只是重定向回登录页面并重新开始该过程。我该如何解决这个问题?
我创建了一个新的MVC5Web应用程序,当我尝试使用Google或Facebook登录时,调用了AccountController中的ExternalLoginCallback操作,但是GetExternalLoginInfoAsync()始终返回null:varloginInfo=awaitAuthenticationManager.GetExternalLoginInfoAsync();if(loginInfo==null){returnRedirectToAction("Login");}因为它始终为空,所以它只是重定向回登录页面并重新开始该过程。我该如何解决这个问题?