将用户重定向到登录对话框后
$url = "https://graph.facebook.com/oauth/authorize?client_id=$appid&scope=&" .
"redirect_uri=$process_url";
其中 $process_uri 是表单的 urlencoded url https://my.domain.com/process.php?param1=value1¶m2=value2
。用户返回后,https://my.domain.com/process.php
我对 curl 请求(已尝试先使用file_get_contents
):
$url = "https://graph.facebook.com/oauth/access_token?client_id=" .
"$appid&redirect_uri=$current_url&client_secret=$secret" .
"&code={$_REQUEST['code']}";
我得到{ "error": { "message": "Error validating verification code.", "type": "OAuthException", "code": 100 } }
。
谷歌搜索后,我意识到可能导致问题的主要原因是redirect_uri
curl 请求错误。redirect_uri
问题是: curl 请求中应该包含什么?https://my.domain.com/
? 或者https://my.domain.com/process.php
?或者https://my.domain.com/process.php?param1=value1¶m2=value2
?
先感谢您!