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
Username for authentication
Password for authentication
SSO token (alternative to username/password)
Response
JWT token for subsequent API requests
Get User Info
Retrieve information about the currently authenticated user.Response
Whether the user is currently logged in
Username of the authenticated user
Token issuer (e.g., “argocd” or SSO provider)
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.Project name
Role name within the project
Human-readable description of the token
Token lifetime in seconds (0 for no expiration)
Custom identifier for the token
Delete Project Token
Revoke a project token.Project name
Role name
Token issued-at timestamp
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
No valid authentication provided or token expiredSolution: Obtain a new token via login
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