ASP.net identity - external login - won't log out

为君一笑 提交于 2019-12-02 00:54:18

According to this ASPNet Identity Work Item, this is by design, and you need to call directly to Google's API in order to log the user out.

Farouk Belhocine

completing the post Logout link with return URL (OAuth) Here is a solution that work for me :

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
        AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
        return Redirect("https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=https://[url-of-your-site]");
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!