public async Task <IActionResult> AlternateLogin(string message = "") { await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme); ViewData["Message"] = AuthenticationChallengeConstants.GetMessage(message); return(View()); }
public static void Main(string[] args) { IWebHost host = BuildWebHost(args); using (IServiceScope scope = host.Services.CreateScope()) { IServiceProvider services = scope.ServiceProvider; ApplicationDbContext context = services.GetRequiredService <ApplicationDbContext>(); UserManager <ApplicationUser> usermanager = services.GetRequiredService <UserManager <ApplicationUser> >(); AuthenticationChallengeConstants.AddInitialData(context, usermanager); } host.Run(); }
public async Task <IActionResult> Login(string returnUrl = null, string message = "") { // Clear the existing external cookie to ensure a clean login process await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme); ViewData["Message"] = AuthenticationChallengeConstants.GetMessage(message); ViewData["ReturnUrl"] = returnUrl; if (TempData.ContainsKey("ssn") && TempData.ContainsKey("account") && TempData.ContainsKey("balance")) { ViewData["ssn"] = TempData["ssn"]; ViewData["account"] = TempData["account"]; ViewData["balance"] = TempData["balance"]; } return(View()); }