0
現在、web経由でapiに接続しています。トークンシークレットを自動化し、auth内のコールバック関数からuserIdを取得できました。 3(トークンを生成する)私はいつも署名のエラーを取得します。可能であれば、基本ロジックが助けてください。アクセストークンリクエストにoauth 1.0で署名するにはどうすればいいですか?
nonce = getNonce(32);
date = Math.round((new Date()).getTime()/1000.0);
var requestSig = oauthSign.hmacsign(
'GET',
'https://oauth.withings.com/account/access_token',
{oauth_consumer_key: <myconsumerkey>,
oauth_nonce: nonce,
oauth_signature_method: 'HMAC-SHA1',
oauth_timestamp: date.toString(),
oauth_token: oauth_token,
oauth_version: '1.0'
}, newSecret);
var hey = encodeURIComponent(requestSig);
var permanentTokensLink = "https://oauth.withings.com/account/access_token?oauth_consumer_key=<myconsumerkey>&oauth_nonce="+nonce+"&oauth_signature="+hey+"&oauth_signature_method=HMAC-SHA1&oauth_timestamp="+date+"&oauth_token="+oauth_token+"&oauth_version=1.0";
return {link:permanentTokensLink, newSecret: newSecret, tokensecret: oauth_token_secret, dataObj: dataObj, token: oauth_token};
newSecrectはconsumersercret & tokensecretある、と私はアクセスキーとシークレットを取得するためにクリックすることができるはずどこpermanentTokensLinkです。なぜこれは機能しないのですか?