简体   繁体   English

Google plus SSO在Android应用中注销功能

[英]Google plus SSO sign out functionality in android app

I know how to perform action on for SSO using Google Plus in android. 我知道如何在Android中使用Google Plus对SSO执行操作。 I am successfully able to login app using same. 我成功地能够使用相同的方式登录app。

Now I need to log out user so that he/ she can log in app again using Google plus with a new account. 现在,我需要注销用户,以便他/她可以使用Google plus再次使用新帐户登录应用。 I need to do same in another activity. 我需要在另一个活动中做同样的事情。

I have tried using disconnect() method but with no success. 我尝试过使用disconnect()方法,但没有成功。

Any help on this is appreciated. 对此有任何帮助表示赞赏。

You can find in the docs how to sign out the user. 您可以在文档中找到如何注销用户。 The relevant part is this: 相关部分是这样的:

if (mGoogleApiClient.isConnected()) {
      Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
      mGoogleApiClient.disconnect();
      mGoogleApiClient.connect();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM