Closed blesenechal closed 7 months ago
Edit: disregard that I thought this was an issue and not a finished PR lol. Definitely gonna add this to mine.
Thanks!.
The token-handling logic as of commit 6350fb7 failed with "Failed to parse Connect Session Auth Token". According to a comment in a Jira community forum,
Apparently the Jira documentation about this was wrong. We shouldn't use Bearer authentication, but instead try to authenticate with OAuth1 standart.
The recommended approach is to use HTTPBasicAuth
from from requests.auth
. Using this approach resolved the error for me. I modified your logic in main
as follows:
if options.bearer is not None:
# Generate JIRA Personal Access Token and use --bearer=ABCDEF012345 commandline argument
# auth = {'Authorization': 'Bearer ' + options.bearer}
# the above doesn't work: "Failed to parse Connect Session Auth Token"
# see https://community.atlassian.com/t5/Jira-questions/How-to-deal-with-quot-Failed-to-parse-Connect-Session-Auth-Token/qaq-p/829057
user = options.user if options.user is not None else input("Username: ")
auth = HTTPBasicAuth(user, options.bearer)
Add ability to login using an OAuth token, such as Personal Access Token.