将 OpenID 委托给 Google(而非 Google Apps)

发布于 2024-08-27 05:16:04 字数 142 浏览 4 评论 0原文

是否可以使用我的个人网站/博客登录使用 openid 的网站,并委托给我的 Google 帐户?


好的,我在 SO 上搜索了这个问题,但没有好的答案。花了一些时间后我想出了如何去做。我将亲自回答这个问题,作为分享的一种方式。

Is it possible to use my personal website/blog to login to sites that use openid, and delegating to my Google account?


OK, I searched this question on SO but no good answer. After spent some time I figured out how to do it. I'm going to answer this myself as a way to share it.

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

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

发布评论

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

评论(3

别在捏我脸啦 2024-09-03 05:16:04

现在可以将 OpenID 委托给您的 Google 帐户(而不是 Google Apps)

不,这不是使用 App Engine 的演示 OpenID 提供程序。这是您真正的 Google 帐户!

首先,您需要启用您的 Google 个人资料。尝试查看您的个人资料并对其进行编辑,应该有一个选项可以设置您的个人资料 URL。您有两种选择:使用您的 Gmail 帐户名(不带 @gmail.com 部分)作为您的个人资料 ID,或者分配给您的随机数字。由您决定使用哪一个。不管怎样,该 ID 就是下面您的个人资料 ID。

现在将以下 HTML 代码添加到您的委托页面:

<link rel="openid2.provider" href="https://www.google.com/accounts/o8/ud?source=profiles" /> 
<link rel="openid2.local_id" href="https://profiles.google.com/[YOUR PROFILE ID]" /> 

这样就完成了。现在尝试使用您的自定义网址登录!

Now it is possible delegate OpenID to your Google account (not Google Apps).

No, this is not using the demo OpenID provider using App Engine. This is your REAL Google account!

First you need to enable your Google Profiles. Try to view your profile and edit it, there should be an option to set your Profile URL. You have two choices there: either use your Gmail account name (without the @gmail.com part) as your profile id, or a random number assigned to you. It's up to you to decide which one to use. Either way, that id is your profile id below.

Now add the following HTML code to your delegating page:

<link rel="openid2.provider" href="https://www.google.com/accounts/o8/ud?source=profiles" /> 
<link rel="openid2.local_id" href="https://profiles.google.com/[YOUR PROFILE ID]" /> 

And it's done. Now try login SO with your custom url!

口干舌燥 2024-09-03 05:16:04

无论接受的答案如何,您不需要加入 Google+ 即可使用 Google 作为代理人,因为您已经拥有本地 ID,即电子邮件中 ​​@

给定现有 Google 帐户[电子邮件受保护],您只需要在您的委托页面 head 部分中添加以下两个链接:

<link rel="openid2.provider" href="https://www.google.com/accounts/o8/ud">
<link rel="openid2.local_id" href="https://profiles.google.com/some-name">

我刚刚执行了此操作,并已验证它在未加入 Google+ 的情况下是否有效。

Despite what the accepted answer says, you do not need to join Google+ to use Google as a delegate since you already have a local ID, being the part of your email preceding the @.

Given an existing Google account of [email protected], you simply need the following two links in your delegate page head section:

<link rel="openid2.provider" href="https://www.google.com/accounts/o8/ud">
<link rel="openid2.local_id" href="https://profiles.google.com/some-name">

I just did this and have verified it works without having joined Google+.

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