0

I am creating a PHP application in which I want to implement Openid login. I want to implement the following functionality:

If user has already logged in his Google Apps account, then PHP application should not ask him login info again.

How can I check in custom PHP application login, that user has already logged in his Google Apps account? I am using PHP lightopenid.

halfer
  • 19,824
  • 17
  • 99
  • 186
Vishal Suri
  • 447
  • 2
  • 12
  • 32
  • Potentially a duplicate of: http://stackoverflow.com/questions/8560940/log-in-log-out-user-status-with-lightopenid – Andrew Ty. Apr 19 '13 at 07:03

1 Answers1

1

You can not. You cannot simply check if a random visitor is authenticated on some other random 3rd party site. Because it's none of your business and would be quite a privacy problem.

You can only go through a normal OpenID login process, redirecting the user to Google and see what you get back.

Maybe you mean to implement your login system? An OpenID login just tells you who a user is. It does not remember the user for you or implement any kind of session or permission system for you. If the user has successfully used OpenID to authenticate with your site once, keep track of him using sessions, cookies, database entries or whatever else you need on your site.

deceze
  • 510,633
  • 85
  • 743
  • 889