AtlassianApiModule
Supported versions
Supported Cortex XSOAR versions: 6.5.0 and later.
AtlassianApiModule#
This API module provides shared OAuth 2.0 authentication functionality for Atlassian products (Jira, Confluence), supporting both Cloud and On-Prem/Data Center instances.
Classes#
AtlassianOAuthClient (Abstract Base Class)#
Base class for Atlassian OAuth 2.0 authentication with the following features:
- Access token management with automatic refresh
- OAuth 2.0 authorization flow
- Integration context storage for tokens
Methods#
get_access_token(): Retrieves valid access token, refreshing if neededoauth2_retrieve_access_token(code, refresh_token): Exchanges code/refresh token for access tokenoauth_start(): Initiates OAuth flow and returns authorization URLoauth_complete(code): Completes OAuth flow with authorization codetest_connection(): Tests OAuth authentication
JiraCloudOAuthClient#
Concrete implementation for Jira Cloud with predefined scopes:
read:audit-log:jiraread:jira-useroffline_access
JiraOnPremOAuthClient#
Concrete implementation for Jira On-Prem/Data Center with:
- PKCE (Proof Key for Code Exchange) support for enhanced security
- Scope:
ADMIN(provides admin-level access required for audit log retrieval) - Server-specific OAuth endpoints
Usage#
Jira Cloud#
Jira On-Prem/Data Center#
Integration with Atlassian Integrations#
This module is designed to be imported by Atlassian product integrations that need OAuth 2.0 support:
- Jira: JiraEventCollector (supports both Cloud and On-Prem), JiraV3 (future refactoring)
- Confluence: Future integrations
The module handles all OAuth token lifecycle management, allowing integrations to focus on their core functionality.
Function Names#
create_atlassian_oauth_client()- Generic factory function (recommended)create_jira_oauth_client()- Backward-compatible alias (same ascreate_atlassian_oauth_client)
Key Features#
- Automatic Instance Detection: Factory function automatically creates the correct client type based on
cloud_idparameter - PKCE Support: On-Prem implementation uses PKCE for enhanced security
- Token Management: Automatic token refresh with 10-second expiry buffer
- Error Handling: Comprehensive error messages for troubleshooting