这是我能够完成的工作:
1.)重定向以获取权限并登录
https://www.facebook.com/dialog/oauth?client_id=APPID&redirect_uri=MYURL&scope=manage_pages,publish_stream
2.)在这里获取用户的访问令牌
QString = "client_id=" & APPID & "redirect_uri=" & MYURL & "&client_secret=" & APPSEC & "&code=" & Auth_Code
bytArguments = System.Text.Encoding.ASCII.GetBytes("")
bytRetData = oWeb.UploadData("https://graph.facebook.com/oauth/access_token?" & QString, "POST", bytArguments)
Access_Code = Split(Split(System.Text.Encoding.ASCII.GetString(bytRetData), "&")(0), "=")(1)
是我得到的地方被 400 错误请求所困扰:
我去访问用户的帐户...这实际上只是我自己...并且我收到 400 BAD REQUEST 错误。
bytArguments = System.Text.Encoding.ASCII.GetBytes("access_token=" & Access_Code)
Uri = "https://graph.facebook.com/me/accounts"
bytRetData = oWeb.UploadData(Uri, "POST", bytArguments)
results = System.Text.Encoding.ASCII.GetString(bytRetData)
话虽如此……我做错了什么???
here is what i have been able to accomplish:
1.) redirect to get permissions and to login
https://www.facebook.com/dialog/oauth?client_id=APPID&redirect_uri=MYURL&scope=manage_pages,publish_stream
2.) get access token for user
QString = "client_id=" & APPID & "redirect_uri=" & MYURL & "&client_secret=" & APPSEC & "&code=" & Auth_Code
bytArguments = System.Text.Encoding.ASCII.GetBytes("")
bytRetData = oWeb.UploadData("https://graph.facebook.com/oauth/access_token?" & QString, "POST", bytArguments)
Access_Code = Split(Split(System.Text.Encoding.ASCII.GetString(bytRetData), "&")(0), "=")(1)
here is where i get stumped with a 400 bad request:
I go to access the account for the user...which will only really be myself...and i get a 400 BAD REQUEST error.
bytArguments = System.Text.Encoding.ASCII.GetBytes("access_token=" & Access_Code)
Uri = "https://graph.facebook.com/me/accounts"
bytRetData = oWeb.UploadData(Uri, "POST", bytArguments)
results = System.Text.Encoding.ASCII.GetString(bytRetData)
With this said...WHAT AM I DOING WRONG???
发布评论
评论(1)
您不应该执行 HTTP POST 来获取访问令牌,而应该执行 HTTP GET 来获取查询字符串中的值。
You shouldn't be doing a HTTP POST to get the access token, just a HTTP GET with the values in the query string.