Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

OAuth 1.0 with JavaScript for Jira OKR

Srihari
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 29, 2019

Hi

I'm creating web data connector(WDC) from Jira OKR API to Tableau. 

WDC supports JavaScript and my Jira required OAuth process for authentication.

I Used npmJS, i'm able to get token and token secret (source: https://www.npmjs.com/package/jira-connector ) from Jira.

var JiraClient = require('./index.js');

JiraClient.oauth_util.getAuthorizeURL({

host: 'jenjinstudios.atlassian.net',

oauth: {

  consumer_key: 'your-consumer-key',

  private_key: '-----BEGIN RSA PRIVATE KEY-----\n' +

  'SomePrivateKeyHere\n' +

  '-----END RSA PRIVATE KEY-----'

}

Above JaveScript gives url, token and token secret. we have to go that url and click Allow then Jira (Jira Server) gives verification code. 

Then we have to enter that verification code in below script(swapRequestTokenWithAccessToken) to get Access Token from Jira.

var JiraClient = require('./index.js');

JiraClient.oauth_util.swapRequestTokenWithAccessToken({

host: 'jenjinstudios.atlassian.net',

oauth: {

  token: 'your-oauth-token',

  token_secret: 'your-token-secret',

  oauth_verifier: 'verifier-code-from-jira',

  consumer_key: 'your-consumer-key',

  private_key: '-----BEGIN RSA PRIVATE KEY-----\n'+

'-----END RSA PRIVATE KEY-----'

}

Instead of manually copying the verification code, Is there way in JavaScript captures that verification code or Jira provides that Verification code and it should add code in above script (swapRequestTokenWithAccessToken) to get Access Toke ??

 

Thanks

0 answers

Suggest an answer

Log in or Sign up to answer