Google API/OAUTH/NativeApplicationClient/OAuth2Authenticator > Logout?

非 Y 不嫁゛ 提交于 2019-12-08 04:07:06

问题


I'm building a desktop app that connects to Googles APIs using OATH following the scheme found in this thread:

Google API v3 for dotnet; using the calendar with an API key

And all works fine. I have build a form that shows a WebBrowser to collect the authCode.

But how do I implement "Logout"? Can't find any API functionality for this.


回答1:


Niels, you can do the following things.

  1. Log the user out of Google in the WebBrowser control by going to this URL (https://accounts.google.com/Logout?hl=en)
  2. You can revoke the users Token by calling https://accounts.google.com/o/oauth2/revoke?token={token}
  3. You can further remove cookies, etc from webbrowser by calling You can Delete cookies by calling System.Diagnostics.Process.Start("rundll32.exe","InetCpl.cpl,ClearMyTracksByProcess 2")


来源:https://stackoverflow.com/questions/12664272/google-api-oauth-nativeapplicationclient-oauth2authenticator-logout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!