[生成Oauth访问令牌后如何在Jira Server中使用Rest Api使用传递访问令牌。使用Node.js(请求库)

问题描述 投票:0回答:1
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)
    }
)
node.js oauth request jira jira-rest-api
1个回答
0
投票
可以在发出get请求时以以下方式传递oauth访问令牌

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 })

© www.soinside.com 2019 - 2024. All rights reserved.