我是成功地能够登录使用谷歌,但现在我想注销用户时,他改变他的谷歌帐户密码。
我尝试了以下代码:
OptionalPendingResult<GoogleSignInResult> opr = Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient);
if (opr.isDone()) {
// If the user's cached credentials are valid, the OptionalPendingResult will be "done"
// and the GoogleSignInResult will be available instantly.
Log.d("TAG", "Got cached sign-in");
GoogleSignInResult result = opr.get();
} else {
// If the user has not previously signed in on this device or the sign-in has expired,
// this asynchronous branch will attempt to sign in the user silently. Cross-device
// single sign-on will occur in this branch.
opr.setResultCallback(new ResultCallback<GoogleSignInResult>() {
@Override
public void onResult(GoogleSignInResult googleSignInResult) {
}
});
}...but,即使在更改密码和撤销访问之后,我仍然能够以静默方式登录。我找不到别的东西了。
有人能帮我检测用户是否更改了密码,这样我就可以登录他了吗?
发布于 2016-06-29 18:46:48
我发现了一个同样的问题。https://github.com/googlesamples/google-services/issues/196
根据他们,这是预期的行为,您可能需要从应用程序中显式调用signOut或revokeAccess来实现这一点。
https://stackoverflow.com/questions/38105152
复制相似问题