cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA API Authentication 401

BenAnderson
Level 5
Hi, 

I recently started setting up the JIRA API skill, and have followed the User Guide that comes with it and gone through each step. I have set up the API in the 'Web API Services' section of the BP system settings. I have set up a credential and obtained an API Key from Atlassian. However whenever I try to run it in a process, I keep receiving an error message, "HTTP Status Code:401; Basic authentication with passwords is deprecated".

I have looked in the BP communities, and read through the Atlassian documentation, although I can't seem to find any information on where I am going wrong. Any help on resolving this would be greatly appreciated. The credentials I have work fine when logging in manually.
Please see below for some screenshots of the error message, and API configuration.

Many thanks for any help,
Ben

22057.png
22058.png
22059.png
22060.png
22061.png
22062.png
22063.png
22064.png
22065.png
Many thanks,
Ben

------------------------------
Benjamin Anderson,
Senior Consultant,
UK
------------------------------
Benjamin Anderson, Senior Consultant, UK
12 REPLIES 12

ewilson
Staff
Staff
Hello @Benjamin Anderson,

​Based on the error response, it seems that the authentication mechanism implemented in the Web API connector is no longer supported by JIRA's REST API. We'll need to spend a little time investigating this. Stay tuned.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

@Benjamin Anderson,

When you say the credentials you have work for manually logging in, you're referring to username/password credentials, correct? Do you have an API key by chance? If you review the main JIRA API connector asset's user guide you'll see that it discusses the need for an API key to be used in place of passwords. ​

The deprecation notice, viewable at the URL included in the error message you received, discusses the same thing.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson,
Many thanks for reply.
That's correct. Yeah, I can login to the website with normal credentials (UN and PW). Whenever I use the skill in a BP process I'm using an API key which I generated from the Atlassian website.​
Would I be correct in saying that the above screenshots show that the skill/api has been configured correctly in my environment?
Many thanks,
Ben

------------------------------
Benjamin Anderson,
Senior Consultant,
UK
------------------------------
Benjamin Anderson, Senior Consultant, UK

Hi @Benjamin Anderson,

The Jira REST API requires a BASE64 encoded header that is built from a string of the form:
"useremail:api_token"
- Example: user@example.com:api_token_string


To achieve this within Blue Prism, please find the Base64Encoder Utility on the Digital Exchange here:
https://digitalexchange.blueprism.com/dx/entry/3439/solution/base64encoder-2

You can also find other ways to produce the Base64 on the Jira documentation here:
https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/#get-an-api-token

Hope this helps!​

------------------------------
Manish Kumar
------------------------------

Hi @Manish Kumar,

Many thanks for the reply.

Yeah, I use the Base64 to encode the key as "myemail:apiKey".

I then passed this encoded text into the "Basic Auth" input as: "Basic " & [EncodedText]
Please see below:

21870.png
Many thanks for your help,
Ben​

------------------------------
Benjamin Anderson,
Senior Consultant,
UK
------------------------------
Benjamin Anderson, Senior Consultant, UK

@Benjamin Anderson,

So you're passing "Basic " & [EncodedText] into the WebAPI for the Basic Auth input parameter. All you should be passing in is [EncodedText]. The WebAPI definition already accounts for the "Basic " portion of the header value.

21895.png

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Thanks @ewilson,

I made the change you suggested but unfortunately, I'm getting a status code of 401 now. "HTTP Response Content: Basic authentication with passwords is deprecated". (Which is odd as I'm not using a password - just the API key).

I generated the API key a few days ago following the user guide, so it is valid. ​

Many thanks,
Ben

------------------------------
Benjamin Anderson,
Senior Consultant,
UK
------------------------------
Benjamin Anderson, Senior Consultant, UK

Hi @ewilson,

I was reading through the user guide again for the JIRA api, and noticed the below comment.

21946.png
Does this then mean that I have to manually log in to JIRA through the browser in order to use the API?

Many thanks,
Ben

------------------------------
Benjamin Anderson,
Senior Consultant,
UK
------------------------------
Benjamin Anderson, Senior Consultant, UK

Hello @Benjamin Anderson,

No, I don't think that's the case. It would defeat the purpose of having an API. I'm checking with the developer of the connector to get their input though.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------