将 OpenID 委托给 Google(而非 Google Apps)
是否可以使用我的个人网站/博客登录使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
现在可以将 OpenID 委托给您的 Google 帐户(而不是 Google Apps)。
不,这不是使用 App Engine 的演示 OpenID 提供程序。这是您真正的 Google 帐户!
首先,您需要启用您的 Google 个人资料。尝试查看您的个人资料并对其进行编辑,应该有一个选项可以设置您的个人资料 URL。您有两种选择:使用您的 Gmail 帐户名(不带 @gmail.com 部分)作为您的个人资料 ID,或者分配给您的随机数字。由您决定使用哪一个。不管怎样,该 ID 就是下面您的个人资料 ID。
现在将以下 HTML 代码添加到您的委托页面:
这样就完成了。现在尝试使用您的自定义网址登录!
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:
And it's done. Now try login SO with your custom url!
无论接受的答案如何,您不需要加入 Google+ 即可使用 Google 作为代理人,因为您已经拥有本地 ID,即电子邮件中
@
。给定现有 Google 帐户
[电子邮件受保护]
,您只需要在您的委托页面head
部分中添加以下两个链接:我刚刚执行了此操作,并已验证它在未加入 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 pagehead
section:I just did this and have verified it works without having joined Google+.
Google 帐户的 OpenID 2.0 已消失
https://support.google.com/accounts/answer/6206245
OpenID 2.0 for Google Accounts has gone away
https://support.google.com/accounts/answer/6206245