tags:

views:

63

answers:

2

Is there any good (eazy to understend, small - not lotof code lines) sample of working with google openid? (php) -

What I need is to see how to get users name from google openId ;

a good way of how to integrate openid into my current users DB (tooday in DB I have table user with name and pass)?

and how to get any Idea about if useris currently loged in from this computer with openId?

A: 

not exacatly what you asked for, but this seems like the best place to start.

http://code.google.com/apis/accounts/docs/OpenID.html

Matthew Vines
+1  A: 

Directly with openid -- I don't know any. Yo ushould use some library, which may have examples.

You should use AX to do so. Check your library documentation for information on how to use it.

You can integrate openid into your database, for example, by setting user's password to NULL, and login to his openid. Since you don't need to store any passwords for openid users, you'll be able to distinguish between regular and openid users.

After verification, you need to store the information in some kind of session, just like with any other authentication mechanism -- users logs in, you store his id in session, and then check whether $_SESSION['user_id'] is not empty.

Mewp
Hmmm... I tested it on localhost (with google example you provided) but google sas that required page is invalid... What shall I do?
Blender
Debug, of course. Send me the url generated by $openid->authUrl(), and I'll be able to help you more.It's strange however, since the same code works for me. If you have downloaded the library before, try downloading the most recent version. The example won't work with some previous ones.
Mewp
Blender
I don't know how your server is configured, but it changes ``It's not the library's fault anyway.
Mewp
Alix Axel