Failure to connect Jira using API token authentication with Zapier integration

Issue #14 resolved
Bhushan Marathe created an issue

I am trying to acheive zapier integration to Jira Software Server . I am trying out authentication via API Tokens , but it is giving me the error as per the screenshot.
We are using the Get method and the code is as follows:

// You can do any parsing you need for results here before returning them
const options = {url: 'https://support-staging.blendedperspectives.com/',
method: 'GET',
headers: {
'X-TOKEN': bundle.authData.token,
'X-USERNAME': bundle.authData.username
},
params: {
'token': bundle.authData.token,
'username': bundle.authData.username
}
}
return z.request(options)
.then((response) => {
response.throwForStatus();
const results = response.json;
return results;
});

Please assist.

Comments (5)

  1. Roma Bubyakin [Wombats Corp]

    Hello @Bhushan Marathe

    I am afraid that API Tokens should not be used as X-TOKEN. Let me explain a bit.

    API Tokens (that you are generated on Jira or Confluence profile page) is a direct substitution for your password. That means:

    1. API Tokens is a user password (in Zapier terminology)
    2. Used to authenticate via Basic Auth calls.

    Zapier documentation describe following options of authorization with a password:


    Regarding provided code snippet. You can try something like following code that might work:

    // You can do any parsing you need for results here before returning them
    const options = {url: 'https://support-staging.blendedperspectives.com/',
    method: 'GET',
    params: {
    'username': bundle.authData.username,
    'password': bundle.authData.password // * Put API Token here *
    }
    }
    return z.request(options)
    .then((response) => {
    response.throwForStatus();
    const results = response.json;
    return results;
    });
    

    …or might not. It's not tested and unfortunately I'm not familiar with Zapier customization.
    But what will work is using API Tokens whenever users' password should be used (e.g. Basic or Session auth calls)

    Regards, Roman

  2. Bhushan Marathe reporter

    @Roma Bubyakin [Wombats Corp] Thankyou for your solution. I was trying to test the Zapier integration through API token authentication, since basic authentication causes problems when the account is locked out (capcha enabled). Let me try using API tokens as user password in Basic Auth..

    Regards,

    Bhushan

  3. Log in to comment