skip to Main Content

I’m using Loopback and
I’m trying to user auth for graph api without javascript sdk or passport
I got the code successfully however I can’t exchange it with access token

I followed this guide https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/#confirm

my get request is https://graph.facebook.com/v2.7/dialog/oauth?code={xxxx}&client_secret={xxxx}&client_id={xxx}&redirect_uri={myURL}

myURL is the one used to get the code but not be used again if I understand

If I understand correctly I should it the access_token in the body of the response instead I get this error

{
 "error": {
"message": "Unknown path components: /oauth",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "HXe+214tGpW"
  }
}

2

Answers


  1. $response = $fb->sendRequest(
            'GET',
            '/oauth/access_token',
            [
              'client_id'     => $config['client_id'],
              'client_secret' => $config['client_secret'],
              'grant_type'    => 'fb_exchange_token',
              'fb_exchange_token' => $short_token
            ],
            $short_token,
            null,
            'v2.7');
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search