0
현재 웹을 통해 API를 연결하고 있으며 토큰 비밀을 자동으로 가져올 수 있고 인증 내부의 콜백 함수에서 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이고, I는 액세스 키와 비밀을 얻기 위해 클릭 할 수 있어야 할 곳에 permanentTokensLink이다. 왜 이것이 작동하지 않습니까?