Base URL
Authentication Modes
AGO supports two authentication modes for mobile integration: JWT Authentication for users with accounts, and Widget Authentication for anonymous users or embedded chat widgets.
1. JWT Authentication (Authenticated Mode)
For users with accounts, use JWT tokens alongside the widget authentication headers. TheAuthorization header is added to the standard widget headers:
When a JWT is sent, the
X-User-Anon-Id header is optional: the user identity is taken from the token’s sub claim.When to Use JWT
- Users have registered accounts in your system
- You want full user identity and history
- Users log in through your existing authentication flow
Obtaining a JWT Token
Your backend should generate JWT tokens after user authentication. The token must be signed with the secret configured in your AGO instance.2. Widget Authentication (Anonymous Mode)
For anonymous users or embedded chat widgets, use widget authentication with the following headers:Header Reference
How Widget Mode Works:
- The system creates an anonymous user with email format:
unknown_ago@{user-id}.com - All conversations are tied to this anonymous user
- The same user ID should be used across sessions for conversation continuity
- The real email (if provided) is stored in
additional_infofor admin reference
Widget Mode Setup
Security Considerations
- User ID: Must be unique per device/user and stored persistently
- Domain Validation: The Origin header must match allowed domains exactly
- Anonymous Users: System creates users with format
unknown_ago@{user-id}.com - Real Email Tracking: Optional X-Widget-Email is stored separately for admin reference
Implementation Examples
Swift (iOS) - JWT Mode
Swift (iOS) - Widget Mode
Kotlin (Android) - JWT Mode
Kotlin (Android) - Widget Mode
Best Practices
Related Documentation
- Mobile Messaging API - Send and receive messages
- Mobile Ticketing API - Create support tickets
- Mobile SDK Examples - Complete implementation examples
- Widget Authentication - Widget security details
