PHP Classes

Help redirect URI

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  Help redirect URI  >  (Un) Subscribe thread alerts  
Subject:Help redirect URI
Summary:does not work with redirect URI
Messages:5
Author:azdf gfas
Date:2014-07-11 18:50:48
Update:2014-07-11 21:25:08
 

  1. Help redirect URI   Reply   Report abuse  
Picture of azdf gfas azdf gfas - 2014-07-11 18:50:48
I use "login_with_facebook.php" and set the $client; the login works fine but, when facebook redirect to my page ($client->redirect_uri) i not found the tokens, the url return have $_GET vars type: ".../my_page_return.php?code=*****[...]*****&state=***-*****#_=_ " ¿where are the tokens? and ¿what is code & state?.
Thanks in advance.

  2. Re: Help redirect URI   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-07-11 19:58:03 - In reply to message 1 from azdf gfas
It does not work like that. The redirect response returns a code that is used to get the final token.

It is better that you let the class needs to do the whole process just like in the example.

Also make sure the redirect URL is a full URL with http:// domain etc. included, or else Facebook may not be able to redirect back to your site.

  3. Re: Help redirect URI   Reply   Report abuse  
Picture of azdf gfas azdf gfas - 2014-07-11 20:43:25 - In reply to message 2 from Manuel Lemos
Ok, but if i dont modify "login_with_facebook.php" the result is "This web page has a redirect loop" This is because always execute "$client->Process()" and this call to Redirect() function into "oauth_client.php" or ¿How it should work?.

Thanks for explain me.

  4. Re: Help redirect URI   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-07-11 21:08:46 - In reply to message 3 from azdf gfas
By default the class uses sessions to store tokens. The redirect loop can happen if you have sessions disabled for some reason.

Check your PHP configuration to see if sessions are enabled and if session data is written to session files.

You may want to set the PHP error log file in php.ini to see what is happening in your PHP environment.

  5. Re: Help redirect URI   Reply   Report abuse  
Picture of azdf gfas azdf gfas - 2014-07-11 21:25:08 - In reply to message 4 from Manuel Lemos
Exactly, Enable SESSION = works perfectly; I continue exploring your class.
Thanks.