我正在编写一个微服务,允许使用Fabric Digits提供的有效凭据在后端创建用户。
我从我的iOS客户端上的Digits iOS SDK获得凭据,代码为:
Digits *digits = [Digits sharedInstance];
DGTOAuthSigning *oauthSigning = [[DGTOAuthSigning alloc] initWithAuthConfig:digits.authConfig authSession:digits.session];
NSDictionary *authHeaders = [oauthSigning OAuthEchoHeadersToVerifyCredentials];
我通过了以下curl请求中authHeaders[@"X-Verify-Credentials-Authorization"]
的内容:
curl --get 'https://api.twitter.com/1.1/account/verify_credentials.json' --header 'Authorization: OAuth oauth_signature="xxxx",oauth_nonce="xxxx",oauth_timestamp="1449582920",oauth_consumer_key="xxxx",oauth_token="xxxx",oauth_version="1.0",oauth_signature_method="HMAC-SHA1"' --verbose
不幸的是,我从Twitter API得到了这个错误的回复:
{"code":32,"message":"Could not authenticate you."}
我在SO上找到了其他关于这个问题的线索,但没有一个答案对我有帮助
有什么建议吗?
不要使用https://api.twitter.com/1.1/account/verify_credentials.json用于发送授权标头的url使用此https://dev.twitter.com/rest/reference/get/account/verify_credentials我也有同样的问题,但现在它完全正常工作,请告诉我它现在是否对你有效。