无法保存与SMARTLOCK IdentityProviders.GOOGLE凭据 [英] Can't save IdentityProviders.GOOGLE credentials with SmartLock

查看:203
本文介绍了无法保存与SMARTLOCK IdentityProviders.GOOGLE凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Google+登录我的用户到我们的应用程序。实际的G +登录虽然在服务器上发生的。我回去,如电子邮件,姓名某些用户数据。我用它来存储用户凭据作为一个谷歌帐户。

I'm logging my users into our app using Google+. The actual G+ signing in happens on the server though. I get back some user data such as email and name. I'm using this to store the users credentials as a google account.

当我尝试将它保存的问题就出现了。在回调保存vim的信任状中的Auth.CredentialsApi.save返回任何决议并没有什么最终发生。如果我从vim的信任状删除谷歌IdentityProvider然后将其保存没有密码。

The issue arises when I try to save it. In the callback to save the creds in "Auth.CredentialsApi.save" it returns no resolution and nothing ends up happening. If I remove the Google IdentityProvider from the creds then it saves without a password.

有谁知道为什么当IndentityProvider设置未找到解决方案?

Does anyone know why a resolution is not found when the IndentityProvider is set?

推荐答案

在播放服务8+,任何决议(确认UI)需要保存一个谷歌登入使用智能锁API用户的谷歌帐户(即,凭证的类型设置为 IdentityProviders.GOOGLE 和电子邮件地址匹配一个设备上登录,并且用户没有禁用的设置保存)。请注意,您不能凭证对象上设置两个账户类型和密码的API保存时 - 如果用户有一个密码,只需存储用于认证目的

In Play Services 8+, no resolution (confirmation UI) is required to save a Google Sign-In to the user's Google Account using the Smart Lock API (i.e., the credential's type is set to IdentityProviders.GOOGLE and the email address matches one signed in on the device, and the user has not disabled saving in settings). Note that you cannot set both an account type and password on a credential object when saving with the API -- if a user has a password simply store that for authentication purposes.

这种类型的凭据API调用应该自动保存并立即可用,所以只检查时做此凭据可在 Auth.CredentialsApi.request()使用 CredentialRequest .setAccountTypes(IdentityProviders.GOOGLE)和保存的凭证显示上的 passwords.google.com 并有与谷歌来代替密码。

An API call with a credential of this type should save automatically and be available immediately, so just check that this credential is available when making a Auth.CredentialsApi.request() using a CredentialRequest built with .setAccountTypes(IdentityProviders.GOOGLE) and that the saved credential is shown on passwords.google.com and has "with Google" in place of a password.

当检索此凭证,你可以用它来知道你有与现有帐户的用户,他们与谷歌$ P $签署pviously。然后,您可以自定义UI AUTH这个老用户,或者干脆自动触发该用户的谷歌登录流程,当应用程序启动时使用 Auth.GoogleSignInApi.silentSignIn给他们返回的用户体验(在谷歌的最新版本)方法登录的库。这里是一个完整的<一个href=\"https://github.com/googlesamples/android-credentials/blob/master/credentials-signin/app/src/main/java/com/google/example/credentialssignin/MainActivity.java\"相对=nofollow> code例如。

When retrieving this credential, you can use it to know that you've got a user with an existing account and they signed in with Google previously. You then can customize the auth UI for this returning user, or simply trigger a Google Sign-In flow for the user automatically and give them a returning user experience when the app starts using the Auth.GoogleSignInApi.silentSignIn() method in the latest version of the Google Sign-In library. Here's a full code example.

这篇关于无法保存与SMARTLOCK IdentityProviders.GOOGLE凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆