JIRA API Authentication 401
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-01-23 07:30 PM
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
Many thanks,
Ben
------------------------------
Benjamin Anderson,
Senior Consultant,
UK
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-01-23 08:25 PM
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
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-01-23 08:47 PM
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
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-01-23 09:16 PM
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
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-01-23 07:18 AM
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
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-01-23 08:25 AM
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:
Many thanks for your help,
Ben
------------------------------
Benjamin Anderson,
Senior Consultant,
UK
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-01-23 02:57 PM
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.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-01-23 04:56 PM
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
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-01-23 10:06 AM
I was reading through the user guide again for the JIRA api, and noticed the below comment.
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
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-01-23 02:42 PM
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
------------------------------