【发布时间】:2015-02-22 06:15:51
【问题描述】:
我已按照并仔细检查了从 https://dev.twitter.com/oauth/application-only 获取不记名令牌的步骤
我不断收到以下错误:
状态:403禁止
{"errors":[{"code":99,"message":"无法验证您的凭据","label":"authenticity_token_error"}]}
我尝试在正文和查询参数中传递 grant_type=client_credentials。
我点击的网址是:https://api.twitter.com/oauth2/token?grant_type=client_credentials
标题集: 授权:基本 [base64encoded(client_key:client_secret)] 内容类型:application/x-www-form-urlencoded;charset=UTF-8
我正在使用海报作为其余客户端来拨打电话。
谁能指出我可能出错的地方。
非常感谢。
【问题讨论】:
-
使用命令行 curl 似乎对我有用;您可以通过以下方式验证您是否拥有正确的消费者密钥和秘密:
curl -u <consumer_key>:<consumer_secret> -X POST -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" https://api.twitter.com/oauth2/token?grant_type=client_credentials,这应该会给您一个访问令牌
标签: rest twitter oauth oauth-2.0