问题标签 [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 投票
0 回答
781 浏览

android - Android AccountManager 和 Google OpenID

我知道这似乎是一个重复的问题,但我已经阅读了许多其他问题,包括Web 服务凭据 - OpenID/Android AccountManager?. 这是我的情况:

我目前正在从事一个主要用于教育目的和个人用途的项目。它是一个用 PHP 编写的 Web 应用程序,允许您远程管理您的手机(静音、设置警报、定位等)。我想做的是允许用户拥有列出他们的手机的帐户和无需开发整个身份验证/用户管理系统即可进行管理。我认为使用 AccountManager 很容易实现,但我遇到了奇怪的错误,例如:

在愤怒和沮丧中,我已经删除了该代码,因此无法发布导致它的原因。由于无法将手机绑定到帐户,我无法远程管理设备。我感到困惑的部分之一是如何使用 authToken。我不需要使用任何谷歌服务,我只想知道它是否是一个有效的谷歌帐户,然后将他们的谷歌电子邮件存储在服务器端的数据库中。

如果有人能给我一些示例代码或教程,那就太棒了。另外,如果有人认为我的做法是错误的,请告诉我。

PS我擅长含糊不清和忘记细节,所以我事先为任何误解道歉。

0 投票
1 回答
1532 浏览

android - Android 的 Google 帐户验证器支持哪些功能?

Android 方法的API文档有以下说明每个身份验证器支持哪些功能:hasFeaturesAccountManager

帐户功能是特定于身份验证器的字符串标记,用于标识布尔帐户属性。例如,功能用于判断 Google 帐户是否启用了特定服务(例如 Google 日历或 Google Talk)。功能名称及其含义发布在与相关身份验证器相关的某个位置。

有人知道“与相关身份验证器相关联的某个地方”实际上是用于 Google 帐户的身份验证器吗?我想知道支持哪些功能。

0 投票
1 回答
1442 浏览

android - 使用 AccountManager 添加应用程序 Google 帐户

我正在尝试在我的应用程序中添加功能,通过使用方法将谷歌帐户添加到 Android 帐户管理器
mAccountManager = AccountManager.get(getBaseApplicationContext());
Account account = new Account("sample.account", "com.google");
ac.addAccountExplicitly(account, "password", null);
但它表示异常

java.lang.SecurityException: caller uid 10117 is different than the authenticator 的 uid


是否可以在应用程序代码中添加帐户(更精确地登录到现有的谷歌帐户)?我应该使用哪种方法?

0 投票
1 回答
700 浏览

android - 从客户经理中检索访问令牌

我已经为 Facebook 实现了自己的身份验证器并存储access_token在 Accounts Manager 中。

我已经尝试了所有 3 种方法来检索auth_token,但徒劳无功。

在我的方法中,我已经启动了一个线程,并且在该Threads RUN方法中,我尝试了以下方法:-

&你上面显示的方式......

但是我的代码在以上 3 行都被阻止了。没有异常/错误。

我需要auth-token在我的应用程序中获取。

0 投票
1 回答
11012 浏览

android - 获取调用者 uid 10066 与验证者的 uid 不同

我正在使用以下代码将帐户添加到帐户列表中

但每次都会出现以下错误:'caller uid 10066 is different than the authenticationator's uid'

0 投票
2 回答
2013 浏览

android - 列出谷歌应用程序帐户

如何确定特定的 google 帐户是否是 Google Apps 帐户?

我的手机上有 2 个帐户。

一个普通的 Google acc 和一个 Google Apps 帐户

它打印“com.google”作为两者的类型。

0 投票
1 回答
5561 浏览

android - android get gmail username and password from account manager

I am writing a GMail client for Android. I want to list all GMail accounts in a ListView. When the user clicks one item, I want the program to retrieve the password of the corresponding account.

However, I get a SecurityException:

This is my code:

I have all these permissions in AndroidManifest.xml:

According to Android reference, the only permission needed should be MANAGE_ACCOUNTS.

What is the problem of my code?

0 投票
3 回答
9559 浏览

android - 自动添加帐号

我的应用程序需要从服务器同步一些数据。我添加了必要的类(类似于 SampleSyncAdapter)现在我可以通过“设置/同步和帐户”添加帐户。但我想在安装应用程序后添加我的帐户和工作同步(我不希望用户对设置进行任何手动更改)。这个怎么做?

0 投票
2 回答
1260 浏览

android - 如何显示从状态栏通知开始的权限活动?

我正在使用 AccountManager 获取 OAuth 2.0 令牌。

如果令牌是第一次获得,AccountManager 会在状态栏中显示一个通知,这会启动一个请求访问帐户权限的活动。

问题是,如何在不点击通知的情况下立即显示此活动?

0 投票
1 回答
627 浏览

android - 使用硬编码凭据从本机 Android 应用程序访问 Google 日历数据

我正在开发一个 Android 应用程序,它显示特定 Google 帐户(用户无权访问)的 Google 日历数据。我知道 GData 不支持 Android,所以我改用 Google APIs Client Library for Java。我不想将凭据保存在帐户管理器中,因为它们是私有的,并且我不能使用 OAuth,因为这需要用户通过重定向将凭据键入网页,而用户显然不知道凭据。有任何想法吗?

tl;dr:想要访问特定帐户的 Google 日历数据,而不向用户提供凭据或授予他们对该帐户的任何权力。