尝试使用授权代码检索令牌时收到oauth 2.0 401错误

时间:2014-04-10 16:24:11

标签: vb.net oauth-2.0

我正在尝试检索令牌的授权码,但一直收到401错误。我从callbackUrl获取授权代码。

它相信我正在发送请求。我使用我的密钥:secret在授权标头中发送base64 Bearer令牌。我只是不确定从这里做什么来解决问题。我是oauth的新手,所以我不知道我是否有办法从事情的结局来确定问题?我完全被难过......

[callbackUrl]/?scope=READ&state=test&code=98LtBkcY

https://www.[testapi].net/v1/id/oauth/access_token?grant_type=authorization_code&code=98LtBkcY

错误:

HTTP/1.1 401 Unauthorized
Content-Type: application/json
WWW-Authenticate: Bearer realm="null",error='invalid_token",error_description='keymanagement.service.invalid_access_token: Invalid Access Token"
Content-Length: 116

{"fault":{"faultstring":"Invalid Access Token","detail":{"errorcode":"keymanagement.service.invalid_access_token"}}}

我正在使用VB.NET并创建我的持票人令牌,如下所示: Authorization_Token = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(ConsumerKey & ":" & ConsumerSecret)).ToString

1 个答案:

答案 0 :(得分:0)

我得到了它的工作。他们的文档告诉我使用令牌作为Bearer令牌,但是尝试了它并且不使用它。