PHP Classes

No access token

Recommend this page to a friend!

      PHP OAuth Library API  >  All threads  >  No access token  >  (Un) Subscribe thread alerts  
Subject:No access token
Summary:Missing $client->access_token
Author:Roberto Cahanap
Date:2013-05-20 13:29:27
Update:2013-05-21 01:01:31

  1. No access token   Reply   Report abuse  
Roberto Cahanap - 2013-05-20 13:29:27
Hello Manuel,

Thank you for this class.

I Googled for oAuth libraries and found your contribution. I needed an oAuth library with Facebook for my website so I was excited finding this.

I am not familiar with oAuth and also not familiar with Facebook, but this was so easy to implement.

I followed the login_with_facebook.php file and it looks like it was working fine. It redirected me to the $client->redirect_uri that I had set up after logging in properly from the Facebook site.

But my $client->access_token was blank so I was not able to do a $client->CallAPI().

I am sure it was a silly mistake on my end, but why would this happen?

Also, just to verify, does redirecting back to my "Welcome" page from Facebook mean that it was authenticated properly?

Thank you very much for your reply.


  2. Re: No access token   Reply   Report abuse  
Manuel Lemos - 2013-05-20 22:25:07 - In reply to message 1 from Roberto Cahanap
I am not sure what you are doing but usually you should not change the line in the script that sets the redirect_uri.

The class redirects the browser to Facebook for the user to authorize your application. Then it should redirects back to the same script or else the authorization process is not completed and you cannot call the API.

  3. Re: No access token   Reply   Report abuse  
Trevor Panahac - 2013-05-21 01:01:31 - In reply to message 2 from Manuel Lemos
I have it working now Manuel.

I thought the way it worked was that I create a PHP file that has the commands to Initialize / Process, etc.

And then I set the redirect_uri property to another PHP file, in this case my "Welcome" page.

When I made both page as the same, then it works.

I'm going to experiment with this tonight.

Thank you!