PAT (bearer) auth for Atlassian Server/Data Center instances #663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes authentication failures when using Personal Access Tokens (PATs) with Atlassian Server/Data Center instances. Server/DC PATs require Bearer authentication, but the current implementation incorrectly uses Basic authentication, resulting in 401 Unauthorized errors.
The fix properly implements Bearer authentication for Server/DC PATs while maintaining backward compatibility with Cloud instances and other authentication methods.
Fixes: #590 #648
Changes
utils/auth.py
withconfigure_server_pat_auth()
function to properly set Bearer authentication headersjira/client.py
to detect Server/DC instances and use Bearer auth for PATsconfluence/client.py
with the same Server/DC PAT authentication logicTesting
tests/unit/utils/test_auth.py
to test Bearer header configurationtests/integration/test_authentication.py
to verify Server/DC PAT flowtest_server_pat.py
for validationTest Environment Details:
https://jira.company.com
https://wiki.company.com
Checklist
AUTH_FIX.md
documenting the authentication matrix and fix detailsAdditional Context
Authentication Matrix After Fix:
Why This Fix is Important:
Many organizations use self-hosted Atlassian Server/Data Center instances with PAT authentication for security reasons. The current implementation fails for these users because it incorrectly attempts Basic authentication with PATs, which Server/DC instances reject with 401 errors.
This fix enables the MCP Atlassian tool to work with:
Backward Compatibility:
The fix maintains 100% backward compatibility:
Related Documentation: