Overview
Argo CD API supports multiple authentication methods for different use cases. All API requests (except session creation) must include valid authentication credentials.Authentication Methods
Bearer Token Authentication
The recommended method for API access. Include the token in theAuthorization header:
Token Types
- User Tokens
- Service Account Tokens
- Project Tokens
User tokens are obtained by logging in through the Session API.
Cookie-Based Authentication
Used primarily by the web UI. The session cookie is automatically set when logging in via the browser.Session Service API
Create Session (Login)
Establish a new authenticated session.Request
string
required
Username for authentication
string
required
Password for authentication
string
SSO token (alternative to username/password)
Response
string
JWT token for subsequent API requests
Get User Info
Retrieve information about the currently authenticated user.Response
boolean
Whether the user is currently logged in
string
Username of the authenticated user
string
Token issuer (e.g., “argocd” or SSO provider)
string[]
List of groups the user belongs to
Delete Session (Logout)
Invalidate the current session.Project Tokens
Project tokens provide scoped access limited to specific projects.Create Project Token
Generate a new token for a project role.string
required
Project name
string
required
Role name within the project
string
Human-readable description of the token
int64
Token lifetime in seconds (0 for no expiration)
string
Custom identifier for the token
Delete Project Token
Revoke a project token.string
required
Project name
string
required
Role name
int64
required
Token issued-at timestamp
string
Token ID (alternative to iat)
SSO Authentication
For SSO-enabled Argo CD installations:- Redirect to SSO provider
- Complete SSO authentication flow
- Receive token from callback
- Use token for API access
Security Best Practices
Token Storage
Token Storage
- Never commit tokens to version control
- Use secret management systems (Vault, Secrets Manager)
- Rotate tokens regularly
- Use environment variables or secure files
Token Scope
Token Scope
- Use project tokens for project-specific automation
- Limit token permissions to minimum required
- Create separate tokens for different automation tasks
- Set expiration times for temporary access
Network Security
Network Security
- Always use HTTPS for API requests
- Validate TLS certificates
- Consider network policies and firewalls
- Use VPN or private networks when possible
Monitoring
Monitoring
- Monitor token usage and creation
- Set up alerts for suspicious activity
- Audit token access regularly
- Revoke unused tokens
Authentication Errors
Common Error Codes
error
No valid authentication provided or token expiredSolution: Obtain a new token via login
error
Authenticated but insufficient permissionsSolution: Check RBAC policies and token scope
Error Response Example
Token Validation
JWT tokens can be decoded (but not verified without the server secret):Next Steps
Application API
Use your token to manage applications
Project API
Create and manage project tokens