Support » Plugin: WordPress Social Login » User has not authorized your app yet.

  • gnarlyinc

    (@gnarlyinc)


    Use the facebook php sdk, when I try to call a helper function to get an access token, I get an error, that the user has not authorized the app yet. And the user is logged in with WordPress Social Login, and the app is present in my facebook apps.

    $helper = $fb->getCanvasHelper();
                                    $accessToken = $helper->getAccessToken();
                                    try {
                                        $accessToken = $helper->getAccessToken();
                                      } catch(Facebook\Exceptions\FacebookResponseException $e) {
                                        // When Graph returns an error
                                        echo 'Graph returned an error: ' . $e->getMessage();
                                        exit;
                                      } catch(Facebook\Exceptions\FacebookSDKException $e) {
                                        // When validation fails or other local issues
                                        echo 'Facebook SDK returned an error: ' . $e->getMessage();
                                        exit;
                                      }
    
                                      if (! isset($accessToken)) {
                                        echo 'No OAuth data could be obtained from the signed request. User has not authorized your app yet.';
                                        exit;
                                      }
    
                                      // Logged in
                                      echo '<h3>Signed Request</h3>';
                                      var_dump($helper->getSignedRequest());
    
                                      echo '<h3>Access Token</h3>';
                                      var_dump($accessToken->getValue());
  • The topic ‘User has not authorized your app yet.’ is closed to new replies.