Is there any good (eazy to understend, small - not lotof code lines) sample of working with google openid? (php) -
What I need is to开发者_JAVA百科 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?
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.
精彩评论