I am using Jira Software 8.15 and I have create a PAT (Personal Access Token) and I am trying to authenticate using jira-python's basic_auth.
When I use the token I just created I get the following error:
Authentication Failure - Reason : AUTHENTICATED_FAILED
and when I look at the security logs:
<user> tried to login but they do not have USE permission or weren't found. Deleting remember me cookie
However!!
When I use username and password it all works as expected.
So, my question is is there any configuration that I need to change in order to make those PATs usable or is it the case that I can only use username:password to authenticate with Jira Server?
I believe I found the answer I was looking for here
host = "YOUR_JIRA_URL" pat = "YOUR_PERSONAL_ACCESS_TOKEN" headers = JIRA.DEFAULT_OPTIONS["headers"].copy() headers["Authorization"] = f"Bearer {pat}" jira=JIRA(server=host, options={"headers": headers})
Hi @Ventsislav
With cookies you use username:password, what syntax do you use with PAT?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using jira-python and more specifically:
JIRA(
basic_auth=(
validated_data['email'],
validated_data['token']
),
options={
'server': url,
'agile_rest_path': 'agile',
},
max_retries=0,
)
it works just fine with jira cloud, but when it comes to jira server it's not happy with the token - it only accepts password.
However, I managed to overcome this by installing this app
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.