ℹ️ NOTE: Access control rules are managed at Settings → User Management → Access Control → Additional Info tab.
Complete Workflow: JWT to Permissions
1
Configure JWT Field Mappings
In your backend configuration, configure which JWT fields to extract:
2
User Authenticates with JWT
When a user authenticates via the widget with a JWT token:JWT Payload Example:Resulting additional info fields:
3
Create Permission Rules
Create additional info rules that leverage the flattened fields:
Example 1: Department-Based Access
Grant IT support permissions to IT department:Example 2: Subscription Tier Access
Grant premium features to enterprise subscribers:Example 3: Regional Compliance
Grant GDPR-compliant access to European users:Example 4: Combined Conditions
Grant special access to enterprise users in Europe:Example 5: Negative Matching
Grant basic access to non-trial users:Use Case Scenarios
Scenario 1: SaaS Platform with Tiered Access
Business Requirements:- Free users: Basic agent, limited features
- Pro users: Advanced agent, full features
- Enterprise users: Premium agent, priority support, custom features
- Configure JWT to extract
subscription_planfield - Create three rules:
Scenario 2: Multi-Tenant B2B Platform
Business Requirements:- Each client organization has different feature sets
- Internal employees get admin access
- Partners get limited access
Scenario 3: Role-Based Access Control
Business Requirements:- Support agents: Access to support tools
- Managers: Access to analytics and reporting
- Admins: Full system access
Testing Your Rules
Method 1: Verify via Admin UI
Check a user’s profile in the admin panel to see what fields are available for rule matching:- Navigate to Settings → User Management → Users
- Select the user you want to inspect
- Review the Additional Info section to see available fields and values
- Confirm the fields match what your rules expect
Method 2: Test with a Sample User
To verify a rule works as expected:- Create or identify a test user whose additional info matches your rule conditions
- Log in as that user (or use impersonation if available)
- Confirm the user sees the expected agents, knowledge sources, and features based on the applied permissions
Best Practices
- Use Descriptive Names: Make rule names clear and specific
- Set Appropriate Priorities: Higher priority for more specific rules
- Test in Development: Verify rules work before deploying to production
- Document Business Logic: Keep track of why each rule exists
- Regular Audits: Review and update rules periodically
- Use Consistent Naming: Stick to snake_case for field names
- Monitor Performance: Watch for rules that may need optimization
Troubleshooting
Rule Not Applying
Rule Not Applying
- Check if the rule is active
- Verify the user has the expected additional info fields
- Check field names match exactly (case-sensitive after normalization)
- Ensure all conditions in the rule match (AND logic)
- Check if a higher-priority rule might be overriding
Field Not Found
Field Not Found
- Verify JWT field mapping is configured correctly
- Check JWT actually contains the expected field
- Check the user’s additional info fields in Settings → User Management → Users
- Ensure field name normalization is working correctly
Unexpected Permissions
Unexpected Permissions
- Check all active rules that might apply
- Remember rules are cumulative (user gets ALL matching permissions)
- Review priority settings
- Check for wildcard domain rules that might apply
