public IActionResult GoogleLogin() { string redirectUrl = Url.Action("GoogleResponse", "Account"); var properties = AppSignInManager.ConfigureExternalAuthenticationProperties("Google", redirectUrl); return(new ChallengeResult("Google", properties)); }
public IActionResult ExternalLogin(string provider, string returnTo = null) { var redirectUrl = Url.RouteUrl("GetExternalLoginCallBack", new { returnTo }, Request.Scheme); var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); return(Challenge(properties, provider)); }
public IActionResult OnPost(string provider, string returnUrl = null) { // Request a redirect to the external login provider. var redirectUrl = Url.Page("./ExternalLogin", pageHandler: "Callback", values: new { returnUrl }); var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); return(new ChallengeResult(provider, properties)); }
public async Task <IActionResult> OnPostLinkLoginAsync(string provider) { // Clear the existing external cookie to ensure a clean login process await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme); // Request a redirect to the external login provider to link a login for the current user var redirectUrl = Url.Page("./ExternalLogins", pageHandler: "LinkLoginCallback"); var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User)); return(new ChallengeResult(provider, properties)); }