Hi Team
I have similiar error on my methods, i have correct assemblies for both. How can i fix this issue? please help
- using Microsoft.Owin.Security; // Assembly i have used for my MVC web project.
- private IAuthenticationManager AuthenticationManager
- {
- get
- {
- return HttpContext.GetOwinContext().Authentication; // Error is stating this object does not contain definition of GetOwninContext() for HttpContext
- }
- }
- // Same below with this object below;
- public async Task 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();
- // Error state it does not have definition for GetExternalLoginInfoAsync method
- 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);
- }
Guest UserPosted Feb 4, 2020, 8:36 AM
Salman BegPosted Feb 4, 2020, 8:29 AM
Guest UserPosted Feb 4, 2020, 8:24 AM
Salman BegPosted Feb 4, 2020, 8:18 AM