How to connect to JIRA using Google account credentials in Python

I’m working on a Python script that needs to connect to our JIRA instance, but my account uses Google authentication instead of regular username/password login.

When I try the standard authentication method with the python-jira package, it doesn’t work because my account is linked to my Google email:

from jira import JIRA

server_url = 'https://mycompany.atlassian.net'
options = {'server': server_url}

# This approach fails for Google-authenticated accounts
jira_client = JIRA(options, basic_auth=(config['USER_EMAIL'], config['USER_PASS']))

The authentication fails since my JIRA account is set up through Gmail single sign-on. What’s the correct way to handle Google-based authentication when connecting to JIRA programmatically? Do I need to use OAuth tokens or is there another authentication method that works with Google accounts?

you can also use personal access tokens if your jira admin turned them on. go to user settings > security > create and manage api tokens. just use the token instead of your password in basic_auth - way easier than setting up oauth and works perfectly for scripts

OAuth2 is another solid option for Google-authenticated JIRA accounts. First, create an OAuth app in your Atlassian developer console, then run the oauth flow with python-jira. I like this better than API tokens - you get granular permission control and automatic token expiration. Takes more setup work upfront but it’s worth it for production. You’ll pass the access token to the JIRA constructor instead of using basic_auth. The python-jira docs have good OAuth examples once you’ve got your consumer key and private key sorted out.

Had the same issue when we switched to Google SSO. Google-authenticated accounts don’t have regular passwords in JIRA - you need an API token instead. Go to your Atlassian account settings, find API tokens, and create one. Use your email as username and the token as password in your basic_auth tuple. Works perfectly with python-jira and keeps the same auth structure you’re using now.