Authentication Overview
Bindu supports Auth0 authentication to secure your AI agents with industry-standard OAuth 2.0 and JWT tokens, enabling fine-grained access control for your agent services.Why Authentication?
Authentication provides:- Security - Protect your agents from unauthorized access
- Audit Trail - Track which service or user performed which action
- Access Control - Fine-grained permissions for different operations
- Multi-tenancy - Isolate different clients or organizations
- Compliance - Meet security and regulatory requirements
Supported Authentication Methods
Auth0 (Current)
Bindu currently supports Auth0 for authentication with:- ✅ Machine-to-Machine (M2M) - Service-to-service authentication
- ✅ JWT Validation - Signature verification using JWKS
- ✅ Permission-Based Access - Fine-grained operation control
- ✅ Token Caching - Automatic refresh and caching
- ✅ Public Endpoints - Agent discovery remains accessible
Coming Soon
Additional authentication providers on the roadmap:- 🔜 GitHub OAuth - Authenticate with GitHub accounts
- 🔜 AWS Cognito - Enterprise identity management
- 🔜 Google OAuth - Sign in with Google
- 🔜 Azure AD (Microsoft Entra) - Enterprise SSO
How It Works
Authentication Process
- Client requests token from Auth0 with credentials
- Auth0 issues JWT with permissions and metadata
- Client includes token in Authorization header
- Agent validates token using Auth0’s public keys
- Agent checks permissions against required scopes
- Request processed if authorized
Configuration
Enable Authentication
Add authentication configuration to your agent:Configuration Options
| Field | Required | Description |
|---|---|---|
enabled | Yes | Enable/disable authentication |
domain | Yes* | Auth0 tenant domain |
audience | Yes* | API identifier |
algorithms | No | JWT algorithms (default: ["RS256"]) |
issuer | No | Token issuer (auto-generated) |
jwks_uri | No | JWKS endpoint (auto-generated) |
require_permissions | No | Enable permission checking |
permissions | No | Permission mappings for methods |
enabled: true
Public vs Protected Endpoints
Public Endpoints (No Authentication)
These endpoints are always accessible:/.well-known/agent.json- Agent card (discovery)/did/resolve- DID resolution/agent/info- Agent information/health- Health check
Protected Endpoints (Authentication Required)
These require valid JWT token:POST /- All JSON-RPC methods:message/send- Send messages to agenttasks/get- Get task detailstasks/cancel- Cancel running taskstasks/list- List all taskscontexts/list- List conversation contextstasks/feedback- Provide task feedback
Permission-Based Access Control
Enable Permissions
Configure fine-grained access control:Permission Scopes
Define permissions in Auth0 API:agent:read- Read tasks, contexts, agent infoagent:write- Send messages, create tasks, provide feedbackagent:admin- Cancel tasks, clear contexts, admin operations
How It Works
- Define permissions in Auth0 API settings
- Grant permissions to M2M applications
- Auth0 includes permissions in JWT token
- Agent validates token has required permissions
- Request allowed/denied based on permissions
Error Codes
| Code | Message | Description |
|---|---|---|
-32001 | Authentication required | No Authorization header provided |
-32002 | Invalid token | Signature verification failed |
-32003 | Insufficient permissions | Token lacks required permissions |
-32004 | Token has expired | Token exp claim has passed |
Error Response Example
Security Best Practices
Recommended Practices
- ✅ Store credentials securely - Use environment variables
- ✅ Use HTTPS in production - Encrypt all traffic
- ✅ Rotate secrets regularly - Update client secrets periodically
- ✅ Grant minimum permissions - Principle of least privilege
- ✅ Monitor Auth0 logs - Track suspicious activity
- ✅ Cache tokens - Reduce Auth0 API calls
- ✅ Separate environments - Use different tenants for dev/staging/prod
- ✅ Validate audience - Ensure tokens are for your API
- ✅ Check token expiration - Implement automatic refresh
- ✅ Use short-lived tokens - Reduce exposure window
Quick Start
1
Create Auth0 Account
Sign up at auth0.com and create a tenant.
2
Configure API
Create an API with identifier
https://api.bindu.ai and define permissions.3
Create M2M Application
Create a Machine-to-Machine application and authorize it for your API.
4
Enable in Agent
Add auth configuration to your agent config with Auth0 credentials.
5
Test Authentication
Use the provided client examples to test authenticated requests.
Client Examples
Python
JavaScript/TypeScript
Troubleshooting
Authentication required error
Authentication required error
Cause: No Authorization header provided.Solution: Include
Authorization: Bearer <token> header in all requests to protected endpoints.Invalid token signature
Invalid token signature
Cause: Token signature verification failed.Solution: Verify
domain and audience in agent config match Auth0 settings. Ensure token is not expired.Insufficient permissions
Insufficient permissions
Cause: Token lacks required permissions.Solution: Grant required permissions to M2M application in Auth0 dashboard.
Token expired
Token expired
Cause: JWT exp claim has passed.Solution: Implement automatic token refresh in your client. Tokens typically expire after 24 hours.
Next Steps
Auth0 Setup Guide
Complete step-by-step Auth0 configuration
Azure AD Setup
Configure Azure AD authentication
Roadmap
See upcoming authentication features
GitHub
View code examples and contribute
Resources
- Auth0 Documentation - Official Auth0 guides
- JWT.io - Debug and decode JWT tokens
- OAuth 2.0 Spec - OAuth 2.0 specification
- GitHub Examples - Client implementation examples