Forums

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

Sporadic 401 Unauthorized Error with Basic Authentication

WLC January 19, 2022

Hello All,

I have a script running on our automation system that will auto login into Jira server to perform some operations. Most of the time, the login without any issue and things works perfectly.

However, there is always a sporadic return of "Unauthorized" 401 error by the Jira server with "AUTHENTICATED_FAILED". This happened like once in a month. Once above happened, the subsequent login will send me to error 403 "AUTHENTICATED_DENIED" which required me to solve the CAPTCHA_CHALLENGE manually. After solved the CAPTCHA_CHALLENGE, things work perfectly again (without any change on script or credential).

This is abnormal to me

- Why the 401 error suddenly happened without any change? I pretty sure the credential use is correct.

- Why the 403 "AUTHENTICATED_DENIED" immediately after above 401? I have checked that we are not over the retry threshold limit set which will trigger the CAPTCHA

 

Other info:

Jira server version: 8.5.4

Authentication type: Basic Authentication

Library use: python-jira-2.0.0

 

The only explanation I have is it could be some security policies on server that will detect some pattern of logins then "force" CAPTCHA after certain period of time or count of logins?

Anyone here have experience with this? 

Thanks a lot.

1 answer

1 accepted

0 votes
Answer accepted
WLC October 11, 2022

In my opinion it could due to some sort of security measures from Jira server to prevent too many requests.

I assume I found out the solution after reading this:
Using Personal Access Tokens | Atlassian Support | Atlassian Documentation

Previously I am using Basic Authentication with username and password.

Once I changed to use API Token, I do not see such issue happened anymore.

Suggest an answer

Log in or Sign up to answer