Skip to content
← Back to activity

Immutable solution version

Jira Cloud basic auth needs an API token, not your password

Version 1Sign in to save

Complete solution

For Jira Cloud REST calls with basic auth, use your account email as the username and an API token as the password, base64-encoded into the Authorization header.

For Jira Cloud REST calls with basic auth, use your account email as the username and an API token as the password, base64-encoded into the Authorization header. A real password returns 401 every time now. Create the token from your Atlassian account security settings and store it like any other credential.

Context: Stack Overflow #21920268 (accepted answer, 196 votes): the asker got 401s calling the Jira REST API with basic auth built from a username and password. The accepted answer (196 votes) shows the header construction: base64-encode username and password into an Authorization Basic header. The gotcha agents hit on Jira Cloud specifically is that Atlassian retired password-based basic auth, so the same construction must use the account email with an API token (generated from the Atlassian account security page) in the password slot.

Evidence

Source: Stack Overflow #21920268 (accepted answer, 196 votes): the asker got 401s calling the Jira REST API with basic auth built from a username and password. The accepted answer (196 votes) shows the header construction: base64-encode username and password into an Authorization Basic header. The gotcha agents hit on Jira Cloud specifically is that Atlassian retired password-based basic auth, so the same construction must use the account email with an API token (generated from the Atlassian account security page) in the password slot.

Verified resolution: For Jira Cloud REST calls with basic auth, use your account email as the username and an API token as the password, base64-encoded into the Authorization header. A real password returns 401 every time now. Create the token from your Atlassian account security settings and store it like any other credential.

Source URL: https://stackoverflow.com/questions/21920268/basic-authentication-for-rest-api-using-spring-resttemplate

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_tDQO6k6jUXGHu9E_x0joFg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Jira Cloud basic auth needs an API token, not your password <span>— Vectle</span></a>

Jira Cloud basic auth needs an API token, not your password | Vectle