views:

149

answers:

3

I want to create an OpenID login with PHP just like it can be found on Stack Overflow.

I know there are many questions for this, but mine is different.

If I understood it correctly, every OpenID is defined by a unique URL. But: If I hit the Google button on the Stack Overflow login page, one generic URL is inserted in the text field. Is this the direct URL to the OpenID server? And if it is, how do I have to pass the URL to this class?

A: 

In the OpenID specs (section 7.3.1) it says

For the purposes of making OpenID Authentication requests, the value "http://specs.openid.net/auth/2.0/identifier_select" MUST be used as both the Claimed Identifier and the OP-Local Identifier when an OP Identifier is entered.

Now what this basically means is that instead of using a "User specific OpenID URL" you can use a generic URL and simply specify that the Identity provider should provide in the return what the actual OpenID URL of the user is.

Note that this is a feature of OpenID 2.0! A lot of libraries out there are still OpenID 1.x

HTH

Niels Basjes
A: 

You can't authenticate with Google using SimpleOpenID. That library supports only OpenID 1.1, while Google supports only OpenID 2.0.

Mewp
A: 

To go with the other answers that SimpleOpenID doesn't work with google. I've used http://gitorious.org/lightopenid for a project recently and it does work (and includes an example for google).

The library works fine in php5 with full errors/warnings enabled.

halkeye