Sebastian
Sebastian

Reputation: 1111

Facebook API returns "Invalid OAuth access token signature."

For my website I use the Facebook API to get the events from a few Facebook pages. For this purpose I have created a Facebook app.

However, even though this used to work before, the API now returns an error:

"message": "Invalid OAuth access token signature.",
"type":"OAuthException",
"code": 190,

Here are the steps to reproduce the error:

  1. Go to app's dashboard on https://developers.facebook.com/apps

  2. Get the app id (APP_ID) and the app secret (APP_SECRET)

  3. Use the app id and the app secret to get an access token by using this url:

    https://graph.facebook.com/oauth/access_token?client_id=APP_ID &client_secret=APP_SECRET&grant_type=client_credentials

  4. This returns something like

    {"access_token":"123412342134|f34f34f32fc3rc4rc324r-X","token_type":"bearer"}

  5. I then use this access token to access the events

    https://graph.facebook.com/v2.12/{11239244970}/events/?fields={id,name}&access_token={123412342134|f34f34f32fc3rc4rc324r-X}

  6. However, this returns the error mentioned above, "Invalid OAuth access token signature.".

I'm stuck here. None of the posts on here seem to solve my problem.

I've already tried resetting the app secret, but that didn't help. Any hints are greatly appreciated!

Upvotes: 4

Views: 20948

Answers (2)

Jean Rose Prayco
Jean Rose Prayco

Reputation: 31

To get the Client Access Token for an app, do the following:

Sign into your developer account. On the Apps page, select an app to open the dashboard for that app. On the Dashboard, navigate to Settings > Advanced > Security > Client token.

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

Upvotes: 3

Sebastian
Sebastian

Reputation: 1111

It would appear that the reason for this error is that Facebook currently only returns events for pages using the Pages API if you use a user access token and that user is attending, is interested in or has been invited to the events of the page (as answered by @unknown_b to a related question over here).

Upvotes: 0

Related Questions