使用Fiddler检索访问令牌时出错 [英] Error when retrieve access token using Fiddler

查看:102
本文介绍了使用Fiddler检索访问令牌时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我尝试使用Fiddler检索访问令牌(了解对服务器进行的正确调用)。

我选择了"请求构建器" tab和我用过:

Hi,
I try to retrieve Access Token using Fiddler (to understand what is the right call to make to server).
I selected "Request Builder" tab and I used:

1)Http方法:POST

2)网址:
https://datamarket.accesscontrol.windows.net/v2/OAuth2-13


3)Http版本:1.2

4)请求正文:grant_type = client_credentials& client_id = {client_id}& client_secret = {client_secret}& scope = http://api.microsofttranslator.com

1) Http Method: POST
2) Url: https://datamarket.accesscontrol.windows.net/v2/OAuth2-13
3) Http version: 1.2
4) Request Body: grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}&scope=http://api.microsofttranslator.com

其中client_id和client_secret是页面中检索的值
https://datamarket.azure.com/developer/applications。

where client_id and client_secret are the values retrieve in the page https://datamarket.azure.com/developer/applications.

当我发送请求时,收到HTTP 400结果并且此响应:

When I send the request, I receive HTTP 400 result and this response:

{" error":" invalid_request"," error_description":" ACS90004:请求格式不正确。 \\ nnTrace ID:68534b1c-214d-4f2a-863f-67fcc5d4577d \\\\\\\\\\\\\\\\\\\\\\\\\\\\\

{"error":"invalid_request","error_description":"ACS90004: The request is not properly formatted. \r\nTrace ID: 68534b1c-214d-4f2a-863f-67fcc5d4577d\r\nTimestamp: 2011-11-29 08:01:07Z"}

问题:什么问题?当我尝试通过代码检索访问令牌时收到的错误是相同的。

这是服务器问题吗?

What's the problem? It is the same error that I received when I try to retrieve Access Token by code.
Is it a server problem?

谢谢

Max

Thanks
Max

推荐答案

Hi Max,

Hi Max,

请求访问令牌时尝试UrlEncode()客户端密钥。我们的样本直到今天都没有这一步。问题只发生在包含URL保留字符的客户机密码上。

please try to UrlEncode() the client secret when requesting the access token. Our sample was missing that step until today. The problem happens only with client secrets containing a URL reserved character.

如果有帮助,请告诉我们。

Let us know if this helps,

Chris Wendt

Microsoft Translator

Chris Wendt
Microsoft Translator


这篇关于使用Fiddler检索访问令牌时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆