Test script:
from jira import JIRA
user_name = "my username"
password = "my password"
jira_conn = JIRA(server='http://my.server.com',
basic_auth=(user_name, password))
Error:
jira.exceptions.JIRAError: JiraError HTTP 403 url: http://my.server.com/rest/api/2/serverInfo
text: CAPTCHA_CHALLENGE; login-url=http://my.server.com/login.jsp
response headers = {'X-AREQUESTID': '1036x605910x1', 'X-XSS-Protection': '1;mode=block',
'X-Content-Type-Options': 'nosniff',
'X-Frame-Options': 'SAMEORIGIN',
'Content-Security-Policy': "frame-ancestors 'self'",
'X-ASEN': 'SEN-2105411', 'Set-Cookie': 'JSESSIONID=3D489D7D7A533761610029A9FEBEDE83; Path=/; HttpOnly',
'X-Seraph-LoginReason': 'AUTHENTICATION_DENIED',
'WWW-Authenticate': 'OAuth realm="http%3A%2F2Fmy.server.com"',
'X-ASESSIONID': '161938n',
'X-Authentication-Denied-Reason': 'CAPTCHA_CHALLENGE; login-url=http://my.server.com/login.jsp',
'Content-Type': 'text/html;charset=UTF-8',
'Transfer-Encoding': 'chunked', 'Date': 'Mon, 29 Jun 2020 15:16:49 GMT'}
response text =
The first time I got this error I went to a browser, logged off then in again and in addition to
user+password, a captcha was asked.1.1. Login page asked for this captcha a few times (this is not necessarily surprising) and finally succeeded.
Now I can log in and out from my JIRA server as many times as I want and it works at first in browser.
No matter the conditions I try, this simple code is no longer able to log in (and it was working perfectly until a day before).
1.1. I tried changing
basic_authtoauth. No luck.
Questions:
- Shouldn't a browser succesful log in clear the captcha state?
- I tried to follow Atlassian Cookie-based authentication:
curl -X POST http://my.server.com/jira/rest/auth/1/session -H jira/rest/auth/1/session -d '{ "username": "my username", "password": "my password" }'
but response is:
<h1>Oops, you've found a dead link.</h1>
How can I find the correct URL for my.server.com?
- Which additional info is relevant here.
- What else can I test?
Environment
- Python 3.8 and Python 2.7.
- Py-jira: jira>=2.0.0
- Client is Rwindows-10.
- JIRA server version:
Atlassian Jira Project Management Software (v8.3.1#803002-sha1:00bd3db)
Thanks!
EDIT*
I managed to make curl work simply like this:
curl -X POST 'http://my.server.com' --data '{ "username": "my user", "password": "my password" }'