GetExternalLoginInfoAsync always NULL for google login

Viewed 124

I have the Client Id and secret already for Google Authentication. After selecting account in google to use to login, GetExternalLoginInfoAsync always returns null. I have tried to create new project to see if there's an issue with google however it turns out I can login successfully to my newly created project but I can't do it in my existing project.

I am able to select account in google to use like this screenshot below and after selecting, I still got NULL returns for GetExternalLoginInfoAsync. Is there anything else I need to check?

 [AllowAnonymous]
public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
{
    var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
    if (loginInfo == null)
    {
        return RedirectToAction("Login");
    }
}

enter image description here

0 Answers
Related