pensar auth command automates authentication to web applications, handling login flows, token verification, and auth mechanism discovery.
Synopsis
Description
The auth command helps you:- Automatically authenticate to applications
- Discover authentication mechanisms
- Verify bearer tokens and API keys
- Test existing session cookies
- Export authentication data for pentesting
Authentication data is securely stored and never exposed to AI models. Only authentication results and metadata are processed by AI.
Required Arguments
string
required
Target URL to authenticate against.Should point to the application’s authentication endpoint or base URL.
Authentication Options
string
Username for login.Used for form-based or API authentication.
string
Password for login.
string
API key for authentication.Tests API key authentication schemes.
string
Bearer token to verify.Verifies an existing JWT or bearer token.
string
Existing session cookies to verify.Tests if existing cookies grant authenticated access.
Configuration Options
string
default:"claude-sonnet-4-5"
AI model to use for authentication discovery.
boolean
Disable browser automation tools.Forces API-based authentication only (faster but may not work for complex login flows).
boolean
Only discover authentication requirements without attempting login.Useful for understanding auth requirements before providing credentials.
Examples
Discover Authentication
Learn what authentication is required:Example Output
Example Output
Form-Based Login
Authenticate with username/password:Example Output
Example Output
API Key Verification
Test if an API key is valid:Bearer Token Verification
Verify a JWT token:Example Output
Example Output
Session Cookie Verification
Test existing cookies:OAuth Authentication
For OAuth flows, use discovery first:Authentication Methods Supported
- Form-Based
- JSON API
- Bearer Token
- API Key
- OAuth 2.0
Traditional HTML form login:Handles:
- CSRF tokens
- Hidden form fields
- POST/GET methods
- Session cookies
Use Cases
Pentesting Authenticated Apps
Get auth data before running pentest
Token Validation
Verify JWT tokens and API keys
Auth Flow Testing
Test OAuth and complex auth flows
Session Management
Reuse sessions across multiple pentests
Exported Authentication Data
Authentication data is saved to~/.pensar/auth/<domain>/session.json:
Troubleshooting
Login failed
Login failed
Common causes:
- Incorrect credentials - Verify username/password
- CAPTCHA present - May require manual solving
- Rate limiting - Target may block automated login
- MFA required - See Authentication Guide for MFA support
Token verification failed
Token verification failed
Browser automation not working
Browser automation not working
Try without browser:Or ensure browser dependencies are installed:
Next Steps
Authentication Guide
Learn about advanced auth scenarios
Run Pentest
Use auth data for authenticated pentesting
Sessions
Manage authentication sessions
API Reference
Programmatic authentication API

