Error: Missing redirect_uri parameter. ( website login with facebook)

1.8k views Asked by At

stdClass Object ( [error] => stdClass Object ( [message] => Missing redirect_uri parameter. [type] => OAuthException [code] => 191 ) )

I get this message when I send access_token to graph.facebook.com/oauth/me

if($result){
        print_r(get_data($result));
    }

function get_data($token){
    $ku = curl_init();
    $query = "access_token=".$token;

    curl_setopt($ku, CURLOPT_URL, "graph.facebook.com/oauth/me?".$query);
    curl_setopt($ku, CURLOPT_RETURNTRANSFER, TRUE);
    $result = curl_exec($ku);

    return json_decode($result);    
}
1

There are 1 answers

0
andyrandy On

The API endpoint to get basic user information is graph.facebook.com/me, not graph.facebook.com/oauth/me. You should add "https" too: https://graph.facebook.com/me.