回调网址在access_token参数之前附加#tag

时间:2013-09-30 13:23:34

标签: php facebook facebook-graph-api

这是我从faceboook获得的回调:

http://puneet.com/fb/response.php#access_token=ACCESS_TOKEN&expires_in=6428&state=c7c8de9ea7e6acd251cb5b1cb901c7ce

我无法解析access_token。它说:

Undefined index: access_token.

我已经尝试了所有$_GET$_REQUEST$_SERVER ..问题是什么?

这是我的登录url参数数组:

array(
    'scope' => 'read_stream, friends_likes',
    'redirect_uri' => 'http://puneet.com/fb/response.php',
    'response_type' => 'token',
    'display' => 'popup'    
);

$loginUrl = $facebook->getLoginUrl($params);

1 个答案:

答案 0 :(得分:-1)

我发现了问题:在网址中,您应使用?代替#

http://puneet.com/fb/response.php?access_token=ACCESS_TOKEN&expires_in=6428&state=c7c8de9ea7e6acd251cb5b1cb901c7ce