skip to Main Content

Here’s my code.

var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();

I already tried other suggestions like updating the packages but no luck.

2

Answers


  1. Chosen as BEST ANSWER

    I solved the problem by updating all my owin packages.

    Thank you


  2. Are you checking for an error message sent by the external login provider?
    Here is how I am doing it using an ExternalLoginCallback action in my account controller:

    [AllowAnonymous]
    public async Task<IActionResult> ExternalLoginCallback(string remoteError = null)
    {
        if (remoteError != null)
        {
            ModelState.AddModelError(string.Empty, $"Error from external provider: {remoteError}");
            return View("Login", loginUser);
        }
        var loginInfo = await _signInManager.GetExternalLoginInfoAsync();
        
        (rest of code...)
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search