0
로그인 기능과 별도의 MVCClient를 처리하는 IndentityServer4 프로젝트가 있지만 MVC 클라이언트의 로그 아웃 기능이 필요하지만 이름을 보면이 MVC 클라이언트가 있습니다.IdentityServer4 올바른 로그 아웃 처리
[HttpPost]
[ValidateAntiForgeryToken]
[AllowAnonymous]
public async Task<IActionResult> Logout(LogoutViewModel model)
{
var vm = await _account.BuildLoggedOutViewModelAsync(model.LogoutId);
if (vm.TriggerExternalSignout)
{
string url = Url.Action("Logout", new { logoutId = vm.LogoutId });
try
{
// hack: try/catch to handle social providers that throw
await HttpContext.Authentication.SignOutAsync(vm.ExternalAuthenticationScheme,
new AuthenticationProperties { RedirectUri = url });
}
catch (NotSupportedException) // this is for the external providers that don't have signout
{
}
catch (InvalidOperationException) // this is for Windows/Negotiate
{
}
}
// delete authentication cookie
await _signInManager.SignOutAsync();
return View("LoggedOut", vm);
}
사람이 정말 클라이언트에서 필요한 것을 논리를 설명 할 수 :
public async Task Logout()
{
await HttpContext.Authentication.SignOutAsync("Cookies");
await HttpContext.Authentication.SignOutAsync("oidc");
}
하지만 identityserver4 프로젝트 훨씬 더 할 것 같다 더 복잡한 로그 아웃이 있습니다.
https://github.com/IdentityServer/IdentityServer4.Demo/blob/master/src/IdentityServer4Demo/Quickstart/Account/AccountController.cs –