Skip to content

Comments

Support both PAT and API Token authentication methods#4

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-auth-with-pat
Closed

Support both PAT and API Token authentication methods#4
Copilot wants to merge 1 commit intomainfrom
copilot/fix-auth-with-pat

Conversation

Copy link

Copilot AI commented Jan 8, 2026

The extension was hardcoded to use Bearer token authentication, causing 403 "Failed to parse Connect Session Auth Token" errors for users with Atlassian API Tokens (which require Basic auth with email:token).

Changes

  • Types: Added optional jiraEmail field to AppSettings
  • Authentication logic: Auto-detect auth method in createHeaders():
    • If email provided → Basic auth with base64(email:token)
    • If email empty → Bearer auth with token
  • UI: Added optional email input with helper text clarifying usage
// Before: Only Bearer token
const headers = {
  "Authorization": `Bearer ${settings.jiraPat}`
};

// After: Auto-detect based on email presence
if (settings.jiraEmail) {
  const credentials = btoa(`${settings.jiraEmail}:${settings.jiraPat}`);
  headers["Authorization"] = `Basic ${credentials}`;
} else {
  headers["Authorization"] = `Bearer ${settings.jiraPat}`;
}

Backward compatible—existing users without email continue using Bearer auth.

Original prompt

This section details on the original issue you should resolve

<issue_title>Auth does not work w/ PAT</issue_title>
<issue_description>Image

</issue_description>

<agent_instructions>PAT is correct, App uses Attlassian auth insted of the PAT</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Thank you for your interest! However, this repository is intended for personal use and distribution. We do not accept Pull Requests.

Please fell free to Fork the repository for your own modifications.

(This is an automated message.)

@github-actions github-actions bot closed this Jan 8, 2026
Copilot AI changed the title [WIP] Fix authentication issue with personal access tokens Support both PAT and API Token authentication methods Jan 8, 2026
Copilot AI requested a review from devdorn January 8, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auth does not work w/ PAT

2 participants