Delegate OpenID to Google (NOT Google Apps)

旧街凉风 提交于 2019-12-17 15:04:27

问题


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.


回答1:


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!




回答2:


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 some-name@gmail.com, 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+.




回答3:


OpenID 2.0 for Google Accounts has gone away https://support.google.com/accounts/answer/6206245



来源:https://stackoverflow.com/questions/2541526/delegate-openid-to-google-not-google-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!