OAuth Exceptions!!! HELP!!!

1,388 views
Skip to first unread message

Francisco Gameiro

unread,
Mar 29, 2013, 12:31:51 PM3/29/13
to res...@googlegroups.com
Hi! I'm having real trouble connecting to the facebook api with OAuth. I would like to know if i'm making steps right!

First I created a facebook app and configured permissions for it. On the auth token parameter I have "Query String", don't know if it makes any difference ...

Then, the first time I ran my Java App I did the following:

AccessToken accessToken = new DefaultFacebookClient().obtainAppAccessToken("59397xxxxxxxxxx", "154001c66ih1bv3j128e2c712a54e73");

My application access token: AccessToken[accessToken=iu1h3iu1b231h2b3j1hb31jh3bjh1 expires=null]

Then I store the access token

FacebookClient facebookClient = new DefaultFacebookClient(accessToken.getAccessToken());

And then when I use it to perform an action, which is:

User user = facebookClient.fetchObject("me", User.class);

It gives me the following error:

Exception in thread "main" com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: An active access token must be used to query information about the current user.


------------------------------------------------------------------------------------------------------------------------------------------------------------------

Second time I run the app I choose the other method with the access token provided before:

AccessToken accessToken = new DefaultFacebookClient().obtainExtendedAccessToken("59397xxxxxxxxxx", "154001c66ih1bv3j128e2c712a54e73""iu1h3iu1b231h2b3j1hb31jh3bjh1");

It immediatly throws an exception right away in the line:

Exception in thread "main" com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: No user access token specified


I can only work with the Graph API Token which is only available for 2 hours!!! Can anyone help me ? I'm dying over here, done a lot of tries and couldn't come up with anything. Am I doing something wrong ?

Thanks everyone,

Francisco Gameiro

Francisco Gameiro

unread,
Apr 2, 2013, 10:18:30 AM4/2/13
to res...@googlegroups.com
Anyone ? :)

Burak Karatepe

unread,
Apr 18, 2013, 12:07:25 PM4/18/13
to res...@googlegroups.com
Hi,


Since you only get a Page Access Token from your applicaiton, you can't access to user level information with it.

As it is being said in http://restfb.com/  section -Not sure how to get an OAuth access token?- You can get a user Access Token simply from Graph API Explorer...

Hope this helps,
Cheers.

Not sure how to get an OAuth access token?

It's really easy with the Facebook Graph API. Sign in to Facebook and navigate to the Graph API Explorer app. Click the "Get Access Token" button. That's it!
Keep in mind that this is only useful for quick testing. For production use, you'll need to create a Facebook Application and use it to obtain OAuth tokens for your users. Take a look at the FB Authentication documentation for more details.

On Tuesday, April 2, 2013 5:18:30 PM UTC+3, Francisco Gameiro wrote:
Anyone ? :)

Carlos Esquivel

unread,
Apr 19, 2013, 5:30:47 AM4/19/13
to res...@googlegroups.com
Is it possible to get an OAuth access token without navigating to the Graph API Explorer app??

Marcel Stör

unread,
Apr 19, 2013, 5:42:27 AM4/19/13
to res...@googlegroups.com
On 19.04.2013 11:30, Carlos Esquivel wrote:
> Is it possible to get an OAuth access tokenwithout navigating to the
> Graph API Explorer app??

-> http://www.restfb.com/#initialization

"Not sure how to get an OAuth access token?
It's really easy with the Facebook Graph API. Sign in to Facebook and
navigate to the Graph API Explorer app. Click the "Get Access Token"
button. That's it!
Keep in mind that this is only useful for quick testing. For production
use, you'll need to create a Facebook Application and use it to obtain
OAuth tokens for your users. Take a look at the FB Authentication
documentation[1] for more details."

Cheers,
Marcel

[1] https://developers.facebook.com/docs/authentication/

--
Marcel St�r, http://www.frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Message has been deleted
Message has been deleted

Carlos Esquivel

unread,
Apr 19, 2013, 6:30:26 AM4/19/13
to res...@googlegroups.com
and What the client has extended permissions?


El viernes, 19 de abril de 2013 11:42:27 UTC+2, marcelstoer escribió:
On 19.04.2013 11:30, Carlos Esquivel wrote:
> Is it possible to get an OAuth access tokenwithout navigating to the
> Graph API Explorer app??

-> http://www.restfb.com/#initialization

"Not sure how to get an OAuth access token?
It's really easy with the Facebook Graph API. Sign in to Facebook and
navigate to the Graph API Explorer app. Click the "Get Access Token"
button. That's it!
Keep in mind that this is only useful for quick testing. For production
use, you'll need to create a Facebook Application and use it to obtain
OAuth tokens for your users. Take a look at the FB Authentication
documentation[1] for more details."

Cheers,
Marcel

[1] https://developers.facebook.com/docs/authentication/

--
Marcel St�r, http://www.frightanic.com

Kumar Pallav

unread,
Apr 20, 2013, 6:05:05 AM4/20/13
to res...@googlegroups.com
Hii
Here is sample OAuth code for reference


--
You received this message because you are subscribed to the Google Groups "RestFB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to restfb+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--


Thanks & Regards, 

Kumar Pallav

Analyst Programmer | Business Solution Division  |Wipro Ltd.|Infopark Special Economic Zone | Kusumagiri, Kakkanadu, Kerala 682030, India|cid:image003.png@01CCD99E.E8212C10 +91- 773-663-7166

image001.png

sun0...@gmail.com

unread,
Nov 29, 2013, 5:20:42 AM11/29/13
to res...@googlegroups.com
Hello, I have this problem, did you resolve it? how? Thanks a lot!

在 2013年3月30日星期六UTC+8上午12时31分51秒,Francisco Gameiro写道:
Reply all
Reply to author
Forward
0 new messages