public class User : ControllerBase
{
[HttpGet("GoogleSignIn")]
public async Task GoogleSignIn()
{
await HttpContext.ChallengeAsync(GoogleDefaults.AuthenticationScheme,
GetAuthenticationProperties());
}
[HttpGet("FacebookSignIn")]
public async Task FacebookSignIn()
{
await HttpContext.ChallengeAsync(FacebookDefaults.AuthenticationScheme,
new AuthenticationProperties { RedirectUri = "/welcome" });
}
[HttpGet("TwitterSignIn")]
public async Task TwitterSignIn()
{
await HttpContext.ChallengeAsync(TwitterDefaults.AuthenticationScheme,
GetAuthenticationProperties());
}
[HttpGet("GitHubSignIn")]
public IActionResult GitHubSignIn()
{
return Challenge(new AuthenticationProperties { RedirectUri = "/welcome" }, "Github");
}
public async Task DeleteCookie()
{
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
}
public AuthenticationProperties GetAuthenticationProperties()
{
return new AuthenticationProperties()
{
IsPersistent = true,
ExpiresUtc = DateTime.Now.AddSeconds(5),
RedirectUri = "/welcome",
};
}
}
Above is my code that I've tried. I found that the cookie does get deleted, but the user still remains logged in. Any help would be appreciated. Would I need to maybe use JWT to completely delete the user login since deleting the cookie is not sufficient.