405为访问令牌交换身份验证令牌时出错

时间:2013-01-26 01:42:17

标签: google-drive-api google-oauth

我已通过Google云端硬盘API验证并收到了身份验证令牌

然后我按如下方式创建我的

   AccessUri = new stringBuilder("https://api.dropbox.com/1/oauth/access_token")
   With AccessUri
                .AppendFormat("?code={0}", oAuth.UrlEncode(AccessToken)) 'Received in first part
                .AppendFormat("&client_id={0}", oAuth.UrlEncode(ConsumerKey)) 'Received from google API
                .AppendFormat("&client_secret={0}", oAuth.UrlEncode(ConsumerSecret)) 'Received from google API
                .AppendFormat("&grant_type={0}", oAuth.UrlEncode("authorization_code"))
                .AppendFormat("&redirect_uri={0}", oAuth.UrlEncode(RedirectURL)) 'using http:localhost/authorise.html
   End With
   dim uriAccess as uri = new uri(AccessUri.tostring)

如果我将其粘贴到地址栏中,我会得到错误405方法不允许。如果我在VB.net中将其作为请求发送,我会得到相同的错误

我是否需要在https://code.google.com/apis/console/

中执行任何操作

任何想法

1 个答案:

答案 0 :(得分:0)

使用此终端时,您将没有任何运气:

https://api.dropbox.com/1/oauth/access_token

获取Google OAuth令牌。您应该使用Google的OAuth 2.0服务,而不是Dropbox的服务。