OAuthException: Error validating access token: Session has expired on

1,979 views
Skip to first unread message

ankur bansal

unread,
Apr 9, 2015, 8:43:47 PM4/9/15
to res...@googlegroups.com
I am getting the following error on the following code.

FacebookClient facebookClient = new DefaultFacebookClient(MY_ACCESS_TOKEN, MY_APP_SECRET);

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


I am using the latest RestFb 1.9 Version

Exception in thread "main" com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: Error validating access token: Session has expired on Thursday, 09-Apr-15 17:00:00 PDT. The current time is Thursday, 09-Apr-15 17:37:09 PDT. (code 190, subcode 463)

 
at com
.restfb.DefaultFacebookClient$DefaultGraphFacebookExceptionMapper.exceptionForTypeAndMessage(DefaultFacebookClient.java:1189)
at com
.restfb.DefaultFacebookClient.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookClient.java:1104)
at com
.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:1038)
at com
.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:951)
at com
.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:914)
at com
.restfb.DefaultFacebookClient.fetchConnection(DefaultFacebookClient.java:378)
at helloworld
.FB.readMessage(FB.java:25)
at helloworld
.FB.main(FB.java:20)

What am I missing?

Norbert Bartels

unread,
Apr 10, 2015, 12:56:13 PM4/10/15
to res...@googlegroups.com

Hi ankur,

the access token is expired.

you can check this here: https://developers.facebook.com/tools/debug/access_token/

and the error message tells this, too :)

Cheers

Norbert

Mohammad Faisal

unread,
Sep 3, 2015, 3:40:49 AM9/3/15
to RestFB
Hi Norbet,

Is there any option of validation token by RestFb?

Norbert Bartels

unread,
Sep 3, 2015, 6:03:23 AM9/3/15
to RestFB

Hi,

you can use the graph api request for access token validation. To do this you need an app access token.

https://developers.facebook.com/docs/facebook-login/access-tokens#debug

Should work with restfb, too. You only need a Facebook Client with a app access token.

Regards
Norbert

Reply all
Reply to author
Forward
0 new messages