Overview
The Authentication API provides intelligent authentication capabilities that handle various login mechanisms including form-based auth, OAuth, API tokens, and complex multi-step flows. It securely manages credentials and exports session data for use in subsequent testing. Key Features:- Automatic credential management via CredentialManager
- Support for multiple auth schemes (forms, OAuth, JWT, API keys)
- Browser automation for complex login flows
- CSRF and anti-bot handling
- Email verification support
- Secure credential storage with no raw secrets in prompts
- Session export (cookies, headers, tokens)
runAuthenticationAgent
Authenticate against a target and persist the session for subsequent operations. Authentication Flow:- Agent navigates to the target/login page
- Detects authentication mechanism
- Uses browser tools to fill forms and interact with auth flows
- Handles CSRF tokens, CAPTCHAs, email verification
- Validates successful authentication
- Exports cookies and headers
- Persists auth data to session directory
Parameters
Configuration for the authentication agent
Response
Whether authentication was successful
Human-readable summary of the authentication process
Session cookies in HTTP Cookie header format (e.g.,
"session=abc123; csrf=xyz456")Additional headers required for authenticated requests (e.g., Authorization tokens)Example:
Authentication strategy used (e.g.,
"form-based", "oauth2", "api-key", "session-cookies")Details about any authentication barrier encountered during the process
Absolute path to the persisted auth-data.json file in the session directory
Usage Examples
Credential Management
Automatic Credential Provisioning
When you create a session withauthCredentials, a CredentialManager is automatically created:
CredentialManager:
- Stores secrets securely in memory
- Never exposes raw secrets in AI prompts
- Provides credential IDs for safe reference
- Resolves secrets only at tool execution time
Supported Credential Types
- Username/Password: Traditional form-based authentication
- API Keys: Bearer tokens, API keys
- OAuth Tokens: Access tokens, refresh tokens
- Session Cookies: Pre-authenticated session cookies
- Custom Fields: Any additional auth fields
Authentication Strategies
The agent automatically detects and handles various authentication mechanisms:Form-Based Authentication
- Detects username/password fields
- Handles CSRF tokens
- Manages session cookies
- Follows redirects
OAuth 2.0
- Handles authorization flow
- Manages token exchange
- Exports access tokens
API Key/Bearer Token
- Validates API key format
- Tests protected endpoints
- Exports authorization headers
Session-Based
- Imports existing cookies
- Validates session state
- Exports refreshed session
Related APIs
Blackbox Pentest
Full pentest with automatic auth
Targeted Pentest
Test authenticated endpoints
Attack Surface
Map authenticated attack surface

