Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

OAuth sign out

$
0
0

I followed this blog post https://www.jerriepelser.com/blog/authenticate-oauth-aspnet-core-2/ and modified to use it with Samsung's Artik service (https://developer.artik.cloud/documentation/user-management/authentication.html#obtain-a-token)

I'm able to login, but I'm unable to logout.

On the action for the logout, I have the Logout action calling to HttpContext.SignOutAsync, but it doesn't logout my current user.

private AuthenticationProperties _authenticationProperties;

[AllowAnonymous]
public IActionResult Login(string returnUrl = "/")
{
_authenticationProperties = new AuthenticationProperties() { RedirectUri = returnUrl };
return Challenge(_authenticationProperties);
} public async Task Logout()
{
await HttpContext.SignOutAsync(_authenticationProperties);
if (User.Identity.IsAuthenticated)
{
// This is still true !
}
}

Any ideas in what's wrong ?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>