I managed to save google profile info into user db table but when redirecting to an authorize page it is asking for login username and password, why?
[Route("google-response")]
public async Task<ActionResult> GoogleResponse()
{
var google_csrf_name = "g_csrf_token";
var cookie = Request.Cookies[google_csrf_name];
if (cookie == null)
return StatusCode((int)HttpStatusCode.BadRequest);
var requestbody = Request.Form[google_csrf_name];
if (requestbody != cookie)
return StatusCode((int)HttpStatusCode.BadRequest);
var idtoken = Request.Form["credential"];
GoogleJsonWebSignature.Payload payload = await GoogleJsonWebSignature.ValidateAsync(idtoken).ConfigureAwait(false);
TempData["email"] = payload.Email;
//return Json(payload);
var user = new IdentityUser { UserName = payload.Email, Email = payload.Email };
await _userManager.CreateAsync(user).ConfigureAwait(false);
return RedirectToAction("Index","Category");
how to sign the user in before redirecting?