问题标签 [accountmanager]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
190 浏览

android - 哪种身份验证方法更适合处理 android 上的 Google api 和 Google 帐户?

点击链接:http
://code.google.com/p/google-api-java-client/wiki/Authentication 那里有 4 种方法,它们是:
1. OAuth 1.0a
2. OAuth 2.0 draft 10 (JavaDoc,规范)
3. Android AccountManager
4. ClientLogin(仅适用于某些 Google API 的旧方法)

由于 Googler 并没有过多谈论做出选择,我只是想知道哪个更适合 Android 应用程序开发?
另外,这种选择的优缺点是什么?

0 投票
1 回答
683 浏览

android - Is it possible to use Android API to create a google account using a custom Form?

I'm working on a Welcome app for a new firmware. This app will run right after a factory reset. I would like to know if there's a way to create a google account (if the new user doesn't have one already) for contacts and callendar sync. I've got the SimpleSyncAdapter sample and I'm having a hard time figure out how to use that with a custom activity form that will be one step of the tutorial/welcome app. In the google sample the AuthenticatorActivity starts an AuthenticationService that instantiates the Authentication class.

The Authentication class has the following method:

But I'm not able to instantiate the Authentication class that extends AbstractAccountAuthenticator in my AccountActivity. Also, I'm not sure if this will rly help me. It's not clear to me what this method does.

Can anyone shed some light?

Thank you all!

0 投票
0 回答
219 浏览

android - 从 google id 显示用户名和详细信息并将它们显示在我的 android 应用程序中

实际上,我正在开发一个应用程序,通过它我可以通过我的 google id 进行签名,并且我必须在我的应用程序中显示该 googleid 的名称和图片。我成功地将 google id 存储在我的 android 手机中,但现在我想显示详细信息我的应用程序中的那个id。请帮助我一些示例代码或应用程序......

0 投票
0 回答
630 浏览

android - 获取邮箱地址后获取姓名和图片

我通过客户经理使用以下代码获取用户的电子邮件地址:

我能够提取 authtoken 和 ACCOUNT_NAME(类似于 example@gmail.com)。我的问题是,在收到这封电子邮件后,如何获取用户的其他详细信息,例如真实姓名(如果共享)、个人资料图片等?

0 投票
1 回答
3926 浏览

android - 什么可以保护 Android AccountManager 密码不被其他应用读取?

我正在写 1) 一个在 AccountManager 中存储用户名和密码的应用程序,以及 2) 一个单独的后台服务应用程序,它访问这些凭据以登录到我的服务器等。玩这个,我发现我能够从服务(应用程序 2)调用 AccountManager.getPassword(account) 以访问我使用其他应用程序(应用程序 1)添加到 AccountManager 的帐户类型。

因此,我开始想知道是什么阻止了任意恶意应用程序从 1)包括清单中的字段以具有帐户管理访问权限,然后 2)从迭代特定类型的所有帐户并调用 mAccountManger.getPassword (帐户)在他们身上。我知道在安装过程中,会弹出一个对话框,其中包含应用程序请求使用的所有权限,但我认为我们不能指望普通用户拒绝应用程序,因为它请求可疑权限。

有没有办法防止 getPassword 在帐户类型上被调用?有没有办法保护 AccountManager 中的帐户免受赋予自己大量帐户权限的应用程序的影响?

0 投票
3 回答
844 浏览

android - 从 AccountManager 凭据访问中取消授权和应用

我有一个正在开发的应用程序,它使用 AccountManager 获取 Google 帐户的凭据,该帐户随后用于从 AppEngine 获取 cookie。我注意到当我将应用程序发送给测试人员时会发现错误,因为他们会收到授权帐户的提示。我需要进行大量测试,并且正在寻找一种方法从特定凭据中“取消授权”应用程序,以便我可以在下一次安装时进行测试。我在设置中找不到任何可以从应用程序中删除对帐户的授权的内容。你知道这样做的方法吗?

谢谢,
有状态的

0 投票
1 回答
1127 浏览

java - AccountManager IllegalArgumentException:键为空

好的,我正IllegalArgumentException处于不应该的地步。

我有一个Account使用 AccountManager 保存的自定义扩展:

键是常量字符串值,但应用程序仍然抛出:

我不得不说我只是以这种方式附加用户数据,因为使用:

似乎没有附加价值。键是否需要特殊的名称模式?

以前有人遇到过这个问题吗?


更新:

它被扔进manager.setUserData()看起来像这样(Android代码)的内部:

当我用 eclipse “走进”这个方法时,我在调试透视图中得到了这个:

在此处输入图像描述

值不为空 >o<

0 投票
1 回答
3739 浏览

android - Android addAccountExplicitly 使用“com.google”类型

我从一天开始就在寻找答案,但我仍然不知道该怎么办!解释问题:我的应用程序使用 GTasks API。为此,用户必须有一个谷歌帐户。我有两种方法可以检查:

  1. 如果没有这样的帐户,我会实例化一个客户经理并寻找“com.google”帐户
  2. 我启动了一个用户登录 Google 并接受使用 API 的 web 视图。

然后,我必须将我的应用程序与 GTask 同步。从 webview 中提取的信息中,我尝试使用 AccountManager 创建一个“com.google”帐户,但我总是遇到错误“Caller UID is different...”。我知道问题应该来自“account-authenticator”,因为“accountType”在 XML 文件和应用程序中必须相同,但我认为情况并非如此,因为当我使用不同的帐户类型时,它可以完美运行(但我无法从 GTask 获得 authToken)。

所以,这是我的代码:

身份验证器.xml:

账户类型定义:

我如何在课堂上使用它:

当我使用“com.plop”或其他东西而不是“com.google”时,它工作得非常好。

所以,我的两个问题是: 1. 我可以使用“com.google”帐户类型吗?2.我不能使用“com.google”以外的其他东西获取我的authToken是否正常(知道使用的帐户仍然是Google帐户,它只是在Android上没有设置)?

提前感谢您的帮助,如果答案在网站上,请原谅我!

0 投票
1 回答
1988 浏览

android - 如何解决“调用者 uid XXXX 与验证者的 uid 不同”的问题?

我收到此错误AccountManager.get(this).getPassword(account)

如何解决这个问题。

提前致谢..!

0 投票
0 回答
26625 浏览

android - 使用 Android 帐户管理器的示例

可能重复:
我应该使用 Android AccountManager 做什么?

我想知道是否有任何简单的例子,使用Android帐户管理器,以便我更好地理解它。

谢谢