Google 帐户所需的同步功能

发布于 2024-12-16 10:49:17 字数 619 浏览 3 评论 0原文

我正在查看 JumpNotes 的代码,但有一件事我无法弄清楚。 JumpNotes:AccountList.java

public static final String[] GOOGLE_ACCOUNT_REQUIRED_SYNCABILITY_FEATURES =
        new String[]{ "service_ah" };

这用于获取谷歌帐户,如下所示:

mAccountManager.getAccountsByTypeAndFeatures(SyncAdapter.GOOGLE_ACCOUNT_TYPE,
            SyncAdapter.GOOGLE_ACCOUNT_REQUIRED_SYNCABILITY_FEATURES,

这个功能“service_ah”是什么?这是什么意思? 有什么方法可以获取 Android 上 google 帐户的身份验证器服务的源代码吗?

I was looking at the code for JumpNotes and there was one thing I just could not figure out.
JumpNotes: AccountList.java

public static final String[] GOOGLE_ACCOUNT_REQUIRED_SYNCABILITY_FEATURES =
        new String[]{ "service_ah" };

This is used to get google accounts like so:

mAccountManager.getAccountsByTypeAndFeatures(SyncAdapter.GOOGLE_ACCOUNT_TYPE,
            SyncAdapter.GOOGLE_ACCOUNT_REQUIRED_SYNCABILITY_FEATURES,

What is this feature "service_ah"? What does it mean?
Is there any way I can get the source for the authenticator service for google accounts on Android?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

地狱即天堂 2024-12-23 10:49:17

来自 Android 文档:

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

我没有找到任何官方文档,但似乎每个功能都是 service_code 形式,其中代码代表 Google 服务。

从这个(过时的)服务列表中,“ah”显然代表“ Google Mashups 编辑器和 Google App Engine”

From Android Documentation:

Account features are authenticator-specific string tokens identifying
boolean account properties. For example, features are used to tell
whether Google accounts have a particular service (such as Google
Calendar or Google Talk) enabled. The feature names and their meanings
are published somewhere associated with the authenticator in question.

I didn't found any official documentation, but it seems that each feature is of the form service_code where code stands for a Google service.

From this (outdated) list of services, "ah" stands apparently for "Google Mashups Editor & Google App Engine"

夏末的微笑 2024-12-23 10:49:17

这个 python Google 帐户身份验证示例并没有多大帮助对于您来说,但我们可以了解以下两件事:

首先,Google 帐户上的连接由 GAE 分两步处理。

>这需要两次调用,一次调用 Google 帐户的 ClientLogin 服务,
然后第二个到 App Engine 的登录前端。

其次,我们可以在第 101 行找到令牌“_ah”,这意味着在这种情况下,我们会启用 cookie,以便下次他想要时使用该服务进行自动身份验证auth(用户数据存储到 cookie 中以跳过第一个 auth 调用)。

因此,在您的情况下,“service_ah”意味着您希望用户进行一次身份验证,然后身份验证过程应由 AccountManager 自动处理。

This python Google account authentication example is not really helpful for you,but we can learn two things as below:

First, the connection on a google account is handled by GAE in two steps.

> This takes two calls, one to the ClientLogin service of Google Accounts,
and then a second to the login frontend of App Engine.

Second, We can find on line 101 the token "_ah", which means in this case that we enable cookies for automatic auth with the service next time he wants to auth (user data are stored into cookies to skip the first auth call).

So in your case "service_ah" means that you want the user to authenticate one time and then the authentication process should be automatically handled by the AccountManager.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文