views:

465

answers:

4

Hi, I am almost done building a facebook application. Its working alright but for one problem. If a user adds the application to his profile for the first time ( by granting appropriate permissions ) it works fine. But when user removes the application from his Application Settings and then tries to add the application again, it just won't work ! When i try to do user.hasAppPermission to check if user has granted appropriate permission to the application, the call throws "Invalid OAuth 2.0 Access Token" exception. I am just clueless why this is happening. I am using PHP-SDK for facebook. The permissions i ask for : "publish_stream" and "email". Need a slight push in right direction.

Thanks.

+1  A: 

Maybe you encountering this because of current facebook bug: http://bugs.developers.facebook.net/show_bug.cgi?id=12707

yeah it's probably the bug. Please go ahead and vote for it
marcgg
A: 

Same facebook drama, different day. Seriously their API's are a minefield in the first place and the support is rubbish.

The URL Linter disappeared for days a while ago, no-one notices or cares.

I'm experiencing exactly the same issue right now, every log-in I attempt on my existing site fails with the error you describe. Looks like the link given in the answer above demonstrates a bug that they've pushed into production and are now desperately trying to fix.

EDIT: Having looked around for a bit, the drama is probably related to this (it is in my case at least):

http://forum.developers.facebook.net/viewtopic.php?pid=273730

FB have started URL encoding their tokens, which causes them to fail.. honestly these guys are useless.

Derek Troy-West
A: 

Great to point it out, though - I first ran into this problem with Koala Gem, and thought that the source of trouble was the Gem. After some work I had switched to FB_Graph Gem, just to find out the same error "Invalid Oauth Access Token" happens there as well.

So it looks like the redirecting step and user approval goes fine, also the token is returned without error. But when the token is being used, the bug kicks in.

Let's hope they fix it fast.

EDIT: Seems to be working now!

Sami
A: 

there is still a problem with "Invalid auth token" in one case: you have been logged as user X to FB on a machine and you were using an application. Then you have unlogged from FB on the same machine, logged as another user eg. user Y and went to the same application again. Then you will certainly get this message. Maybe something should be done by an app developer, eg. some line of code to clear the tokens should be added?

Krzysztof Sobolewski

related questions