Overview
AWX supports multiple authentication methods for API access. All API requests must be authenticated unless accessing public endpoints.Authentication Methods
AWX supports the following authentication methods based on the source code (awx/api/authentication.py):
1. Session Authentication
Session-based authentication using Django sessions. Primarily used by the web UI.2. Basic Authentication
HTTP Basic Authentication with username and password. Must be enabled viaAUTH_BASIC_ENABLED setting.
3. OAuth 2.0 Token Authentication
The recommended method for API access using bearer tokens.Create an OAuth Token
The bearer token to use for authentication
Token used to refresh the access token
Token expiration timestamp
Use the Token
4. Application OAuth Tokens
Create OAuth2 applications for third-party integrations.Create an Application
OAuth client identifier
OAuth client secret (confidential clients only)
Token Management
List Your Tokens
Revoke a Token
Token Scopes
Tokens can have different scopes:- read - Read-only access
- write - Read and write access (default)
Current User Information
Get information about the authenticated user:User ID
Username
Email address
Whether user has superuser privileges
Whether user has system auditor role
Login and Logout Endpoints
Login
Username
Password
Logout
Security Best Practices
Use OAuth Tokens
Use OAuth Tokens
Prefer OAuth tokens over basic authentication. Tokens can be revoked and have expiration times.
Use HTTPS
Use HTTPS
Always use HTTPS in production to protect credentials and tokens in transit.
Rotate Tokens Regularly
Rotate Tokens Regularly
Create new tokens periodically and revoke old ones to minimize security risks.
Use Limited Scopes
Use Limited Scopes
Use read-only tokens when write access is not needed.
Store Tokens Securely
Store Tokens Securely
Never commit tokens to source control. Use environment variables or secret management systems.
Authentication Errors
401 Unauthorized
Missing or invalid authentication credentials:403 Forbidden
Valid authentication but insufficient permissions:Example: Complete Authentication Flow
Proxy and Gateway Authentication
AWX supports trusted proxy authentication via theX-Trusted-Proxy header for integration with authentication gateways. This is configured via REMOTE_HOST_HEADERS and PROXY_IP_ALLOWED_LIST settings.