Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate access token #121

Open
RWOverdijk opened this issue Feb 21, 2017 · 1 comment
Open

Validate access token #121

RWOverdijk opened this issue Feb 21, 2017 · 1 comment

Comments

@RWOverdijk
Copy link

Hello

I wish to validate, from my app, a user's acces token. I can do that using the debug_token endpoint in the graph api.

I can't figure out how to do that using library. Any pointers?

@ffflabs
Copy link

ffflabs commented Jan 31, 2018

I use something in the likes of:

 const graph = require('fbgraph'),
  myApp = {
    FACEBOOK_APP_ID: 123456,
    FACEBOOK_APP_SECRET: 'asdfghjkl'
  },
  graph_options = {
    timeout: 36000,
    pool: {
      maxSockets: Infinity,
    },
    headers: {
      connection: 'keep-alive',
    }
  },
  user_access_token = 'mjNfsEUdvZCVs67DRld5rEAF1TPcuzfMQLzT251IjhwvZBEp7lMyeagd7ShKUezZCr0pdYghH4yZBLlbMjaGV';
 
 graph.setVersion("2.11")
 graph.setOptions(graph_options);
 graph.setAccessToken(`${myApp.FACEBOOK_APP_ID}|${myApp.FACEBOOK_APP_SECRET}`);
 graph.get(`/debug_token?input_token=${user_access_token}`, function (err, res) {
  console.log(res);
 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants