![](/img/trans.png)
[英]How can i safely pass access token generated from Google OAuth to a NodeJS REST API?
[英]How to use pass access token for using Rest Api in Jira Server after generating oauth access token. Using Nodejs(request library)
request.get('http://localhost:8080/rest/api/2/project', { oauth:{ consumer_key:consumer_key, consumer_secret:consumer_secret, oauth_signature_method: RSA-SHA1, token: oauth_access_token, token_secret: oauth_access_token_secret }, qs:{user_id:user_id} // or screen_name }, function (err, res, body) { console.log(err) console.log(body) } )
oauth 訪問令牌可以通過以下方式在發出的 get 請求中傳遞
request.get('http://localhost:8080/rest/api/2/project', {
'auth': {
'bearer': oauth_access_token
},
'qs':{user_id:user_id} // or screen_name
}, function (error, response, body) {
// Do more stuff with 'body' here
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.