Authentication¶
ConfluenceSynkMD supports two authentication methods for connecting to Confluence Cloud. Credentials can be provided via environment variables or CLI flags.
Basic Auth (Email + API Token)¶
This is the default and recommended method for most users.
Setup¶
- Go to Atlassian API Token Management
- Click Create API Token
- Give it a descriptive name (e.g. "ConfluenceSynkMD")
- Copy the token
Configuration¶
Environment Variables¶
CLI Flags¶
Docker (-e)¶
Tip
API tokens inherit the permissions of the Atlassian account that created them. Ensure the account has read/write access to the target spaces.
Bearer Auth (OAuth 2.0)¶
Use OAuth 2.0 for automated/service account access or when API tokens are not available.
Setup¶
- Create an OAuth 2.0 app at developer.atlassian.com
- Configure the required scopes:
read:confluence-content.allwrite:confluence-contentread:confluence-space.summary
- Complete the OAuth 2.0 3LO flow to obtain an access token
Configuration¶
Environment Variables¶
CLI Flags¶
Docker (-e)¶
Token Expiration
OAuth 2.0 access tokens typically expire after 1 hour. For long-running or automated processes, implement token refresh logic in your CI/CD pipeline.
Choosing the Right Method¶
| Method | Use Case | Pros | Cons |
|---|---|---|---|
| Basic Auth | Interactive use, simple CI | Easy to set up, stable tokens | Tied to personal account |
| Bearer Auth | Service accounts, automated pipelines | Fine-grained scopes, no personal account | Tokens expire, more complex setup |
Security Best Practices¶
- Use CI/CD secret variables (not hardcoded)
- Pass credentials via environment variables or CLI flags
- Rotate API tokens regularly
- Never commit tokens to version control
- Never embed tokens in Docker images