Browse Source
Merge pull request #4380 from abpframework/gterdem/front-channel-logout-endpoint
Implement FrontChannel Endpoint
pull/4471/head
Halil İbrahim Kalkan
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
15 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs
|
|
|
@ -52,6 +52,21 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication |
|
|
|
return new SignOutResult(ChallengeAuthenticationSchemas); |
|
|
|
} |
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
public async Task<IActionResult> FrontChannelLogout(string sid) |
|
|
|
{ |
|
|
|
if (User.Identity.IsAuthenticated) |
|
|
|
{ |
|
|
|
var currentSid = User.FindFirst("sid").Value ?? string.Empty; |
|
|
|
if (string.Equals(currentSid, sid, StringComparison.Ordinal)) |
|
|
|
{ |
|
|
|
await Logout(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return NoContent(); |
|
|
|
} |
|
|
|
|
|
|
|
protected RedirectResult RedirectSafely(string returnUrl, string returnUrlHash = null) |
|
|
|
{ |
|
|
|
return Redirect(GetRedirectUrl(returnUrl, returnUrlHash)); |
|
|
|
|