问题描述:

This is a part of getting access_token taken from facebook-sdk example.

After I get the code, I do exactly following the example as below

 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]

The error I get from response is

'{"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}}

Can anybody tell me what is wrong?

This is the link I get in order to get 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

It has https://graph.facebook.com/oauth/access_token?

code, client_secret,redirect_uri,client_id

Do I miss any parameters to get access_token?

网友答案:

I got it. My redirect_uri need a dash "/" at the end of the url.

It should be "http://abc.com/"

Too much painful to find the mistake

相关阅读:
Top