85

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.

4
  • 3
    Add a response to your own questions an mark as correct, that way everyone will see what was the answer in a more persistent manner Mar 29, 2010 at 21:55
  • Thanks Oskar for the tip! However I cannot mark the answer as correct right now. It says I have to wait until tomorrow.
    – Rio
    Mar 30, 2010 at 12:51
  • I've moved the answer out of the question and into your answer, hope you don't mind but it's how SO is generally used. Mar 31, 2010 at 10:04
  • 1
    I wish that the question hadn't been modified because now I don't understand the answer. Mar 8, 2012 at 18:11

3 Answers 3

98

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!

14
  • 1
    Is it possible to have google host delegating page for me like MyOpenID does? Nov 4, 2011 at 12:59
  • 4
    Since google is all plusified now, the profiles.google.com url is no longer what you get when you go to "my profile" however, if your profile is plus.google.com/107217643432815688625/posts then profiles.google.com/107217643432815688625 still seems to work as your openid2.local_id Aug 6, 2012 at 3:38
  • 8
    Currently with G+, you need to put: <link rel="openid2.provider" href="https://www.google.com/accounts/o8/ud" /> <link rel="openid2.local_id" href="https://plus.google.com/GPLUSID" />
    – Sebi
    Feb 6, 2013 at 18:58
  • 1
    @ChrisQuenelle According to my experience, when you change your delegate the only thing that happens is that you are directed to the new site for authentication. The first site still knows your identity as the whatever site you're delegating from. So it's very effortless to switch your authentication provider. Sep 21, 2013 at 20:43
  • 2
    @Sebi, I tried your link elements, but it used my Google identity as my claimed identity, rather than my delegating URL*. Also, it asked me which account of my currently two logged in accounts I wanted to use, so apparently plus.google.com is not the correct hostname to use. I used profiles.google.com with my gmail name instead, and it worked as expected. I have not checked how to use profiles.google.com with a Plus identity. *SuperUser asked to create a new account for myname@gmail.com rather than logging into my existing account based on the OpenID URL I gave it.
    – clacke
    Feb 19, 2014 at 11:29
8

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+.

0
5

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.