public async Task<ActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl) { if (User.Identity.IsAuthenticated) { return RedirectToAction("Manage"); } if (ModelState.IsValid) { // Get the information about the user from the external login provider var info = await AuthenticationManager.GetExternalLoginInfoAsync();// this is error line AIAuthenticationManager does not contain a definition for GetExternalLoginInfoAsync() if (info == null) { return View("ExternalLoginFailure"); } var user = new ApplicationUser() { UserName = model.UserName }; var result = await UserManager.CreateAsync(user); if (result.Succeeded) { result = await UserManager.AddLoginAsync(user.Id, info.Login); if (result.Succeeded) { await SignInAsync(user, isPersistent: false); return RedirectToLocal(returnUrl); } } AddErrors(result); } ViewBag.ReturnUrl = returnUrl; return View(model); }
private IAuthenticationManager AuthenticationManager { get { return HttpContext.GetOwinContext().Authentication;// HttpContext does not contain definition of GetOwninContext line of error } }
Microsoft.AspNet.Identity.Owin on Package Manager Console on your Visual Studio, the error will be gone. Its a missing namespace.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)