PHP Classes

Pre-check facebook logged before redirect?

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  Learn with a PHP OAut...  >  All threads  >  Pre-check facebook logged before...  >  (Un) Subscribe thread alerts  
Subject:Pre-check facebook logged before...
Summary:Ensure that the user is logged on facebook before redirect
Messages:3
Author:André Dias
Date:2017-03-23 15:43:04
 

  1. Pre-check facebook logged before...   Reply   Report abuse  
Picture of André Dias André Dias - 2017-03-23 15:43:04
OAuth is wonderful and this class is grade 10/10, thanks as always.

I have a simple problem, my visitors are very basic computer users and most of them have facebook so they prefer using OAuth, the problem is that when they are not logged on facebook the redirected screen will ask for their facebook login and they think that is suspicious or just close the window in rant and quit the site.

Is it possible to pre-check if the user is logged in facebook so that I could display a different message before redirecting them to facebook?

  2. Re: Pre-check facebook logged before...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2017-03-24 04:47:00 - In reply to message 1 from André Dias
I am afraid there is no way because your site does not know who the user is until it gets token for the first time.

What you can do is to call the CheckAccessToken() function instead of Process() and it will tell you if you would need to redirect or not. Then you can show a login button that will redirect to Facebook dialog telling the user to click there if they want.

Take a loon at the the login_check_with_facebook.php example script:

phpclasses.org/package/7700-PHP-Aut ...

  3. Re: Pre-check facebook logged before...   Reply   Report abuse  
Picture of André Dias André Dias - 2017-03-24 18:00:10 - In reply to message 2 from Manuel Lemos
Thank you very much for your always kind and fast replies.