是否可以从 Twitter Digits 回调中获取用户的电话号码?我正在使用 http 版本和 javascript 发送带有 Twitter 数字的短信。
我只看到下一个信息响应头:
{"oauth_echo_headers":{"X-Verify-Credentials-Authorization":"OAuth oauth_consumer_key=\"gmoaaZhEG88hMQUdpWHnF1IAz\", oauth_nonce=\"3375731039-FmyAQgjhQG9rljUaXO3jBbiryF7dFQHeVL5oxu4gmoaaZhEG88hMQUdpWHnF1IAz1437035638029\", oauth_signature=\"TTbPlgipWdaNCSblfx0qznz%2B2Fc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1437035638\", oauth_token=\"3375731039-FmyAQgjhQG9rljUaXO3jBbiryF7dFQHeVL5oxu4\", oauth_version=\"1.0\"","X-Auth-Service-Provider":"https://api.digits.com/1.1/sdk/account.json"}}
最佳答案
收到凭据授权 header 后,您可以直接查询服务器以从 Digits 服务接收属性。根据 docs :
/* Validate and log user in. */
function onLogin(loginResponse){
// Send headers to your server and validate user by calling Digits’ API
var oAuthHeaders = loginResponse.oauth_echo_headers;
var verifyData = {
authHeader: oAuthHeaders['X-Verify-Credentials-Authorization'],
apiUrl: oAuthHeaders['X-Auth-Service-Provider']
};
$.post('/verify', verifyData)
.done(function(){ window.reload(); });
}
您可以在 Cannonball web demo 中看到一个示例。 .
关于c# - 我可以从 Twitter Digits 回调中获取电话号码吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31449207/