php - Long live access token granting permissions and scopes -


i obtained access token facebook app using graph api explorer , long lived access token server side. unable edit permission , scopes obtained long lived access tokens. have uploaded screen shots of access token debugger both access tokens obtained graph api explorer long lived access token obtained sever side .please on how edit scopes of long lived access tokens server side.

enter image description here

as seen in screen shot in scopes , has many permissions. access token obtained server side has 1 scope "public_profile". how should grant permissions long lived access token obtained server side? please

my code login

<?php    $a=$_get["query"];       $app_id = "xxxxxx";   $app_secret = "xxxxxxxxxx";    $redirect_uri = "http://localhost/url_encode.php/"."?"."f=".$a;  // echo $my_url;   $dialog_url = "http://www.facebook.com/dialog/oauth?client_id="        . $app_id . "&redirect_uri=" .$redirect_uri;      echo("<script> top.location.href='" . $dialog_url        . "'</script>");   code generating long lived access token.        <?php //include ('search_query.php');  $b=$_get['code']; $c=$_get['f']; //echo $b; //echo "<br>"; //echo "<br>"; //echo $c; //$a=$_get['f'];   $redirect_uri="http://localhost/url_encode.php/"."?"."f=".$c;   if(empty($b)){    $dialog_url = "http://www.facebook.com/dialog/oauth?client_id="        . $app_id . "&redirect_uri=" .$redirect_uri;      echo("<script> top.location.href='" . $dialog_url        . "'</script>");      }   $token_url="https://graph.facebook.com/oauth/access_token?client_id=xxxxxx&redirect_uri=".$redirect_uri."&client_secret=xxxxxxxxx&code=".$b; $access_token=file_get_contents($token_url);  //echo $access_token; $position_of_string=strpos($access_token ,"&"); $actual_access_token=substr($access_token,0,$position_of_string); echo $actual_access_token;  $url="https://graph.facebook.com/".urlencode($c); $json_object=file_get_contents($url); 

?>

you missing scope parameter in login flow: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.2

scope: comma separated list of permissions request person using app.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -