这是从facebook-sdk示例中获取access_token的一部分。
获得code
后,我完全按照下面的示例
if self.request.get("code"):
args["client_secret"] = FACEBOOK_APP_SECRET
args["code"] = self.request.get("code")
response = cgi.parse_qs(urllib.urlopen(
"https://graph.facebook.com/oauth/access_token?" +
urllib.urlencode(args)).read())
access_token = response["access_token"][-1]
我从response
得到的错误是
'{"error":{"message":"Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request","type":"OAuthException","code":100}}
有人可以告诉我出了什么问题吗?
这是我获取access_token
的链接https://graph.facebook.com/oauth/access_token?code=AQD3K0Qc-9mJ1pUIWovhbO549GIk-X_y2v6VRbjFB_WtHMtINtU6GTZ4T2rBbjUr9teiGbhxsBm23xjRXhX4CfWdMXgsNXjgTOUeG9Nz6oNmgluvZwv3oQQ42w8vBTowlDGOdKvmW065WrQTLW3e8oZJ7C_XNwUl5bYDD5JF_JLD9O4BBfAGbfRHWHAf6Yy0ewaJr8MmtU-qhemYe8mQ2hrM&client_secret=xxxxx&redirect_uri=http%3A%2F%2F127.0.0.1%3A8088&client_id=xxxx
它有https://graph.facebook.com/oauth/access_token?
code
,client_secret
,redirect_uri
,client_id
我是否会错过任何获取access_token的参数?