0

I'm trying to create a Javascript application that has a filterable listing of certain kinds of public Facebook events. The thing is, the FB Graph API requires that you provide a User Access token in order to use the search for public events. I really don't want to make people log in to facebook in order to use the website, especially because ANY facebook user's credentials are sufficient to query the events I want to query (ie the search is independent of any user credentials, I just need them because the fb api requires me to have a user access token.)

Do y'all have any suggestions for a work around? I'm thinking about providing my own credentials securely, and just using them to make the actual queries. The thing is I would potentially need to be doing A LOT of queries per minute, so this might not be terribly realistic. Any suggestions would be helpful.

sunnyharris
  • 115
  • 1
  • 1
  • 6

1 Answers1

0

Simply do this server-side not client-side.

You just need an app token (no user token) to do this search, but using this client-side is a bad idea since it would expose your app token publicly.

lars.schwarz
  • 1,276
  • 1
  • 8
  • 12
  • Are you sure that I can just use an app token? I did a test run, and unless I did it wrong, I got an authentication error. – sunnyharris Oct 01 '15 at 15:33
  • Pretty sure, yes. How do you generate your token? – lars.schwarz Oct 01 '15 at 15:49
  • Well I read in [this thread](http://stackoverflow.com/questions/12948809/trying-to-get-app-access-token) that you could make a token using APP_ID | APP_SECRET (piped together). I attempted this in the [Graph API Explorer](https://developers.facebook.com/tools/explorer/145634995501895/) And it gave me this error: { "error": { "message": "(#200) Must have a valid access_token to access this endpoint", "type": "OAuthException", "code": 200, "fbtrace_id": "HtjIyNXpcyz" } } Any tips? – sunnyharris Oct 01 '15 at 17:44
  • PHP, Python, CURL, what do you use? – lars.schwarz Oct 01 '15 at 19:25