Skip to main content
This guide provides real-world examples of using access control rules with JWT authentication and additional info fields.
ℹ️ NOTE: Access control rules are managed at SettingsUser ManagementAccess ControlAdditional 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
Implementation:
  1. Configure JWT to extract subscription_plan field
  2. Create three rules:
Free tier (negate paid tiers):
Pro tier:
Enterprise tier:

Scenario 2: Multi-Tenant B2B Platform

Business Requirements:
  • Each client organization has different feature sets
  • Internal employees get admin access
  • Partners get limited access
Implementation: Internal employees:
Partner organizations:
Client-specific features:

Scenario 3: Role-Based Access Control

Business Requirements:
  • Support agents: Access to support tools
  • Managers: Access to analytics and reporting
  • Admins: Full system access
Implementation: Support agents:
Managers:
Admins:

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:
  1. Navigate to SettingsUser ManagementUsers
  2. Select the user you want to inspect
  3. Review the Additional Info section to see available fields and values
  4. Confirm the fields match what your rules expect

Method 2: Test with a Sample User

To verify a rule works as expected:
  1. Create or identify a test user whose additional info matches your rule conditions
  2. Log in as that user (or use impersonation if available)
  3. Confirm the user sees the expected agents, knowledge sources, and features based on the applied permissions

Best Practices

  1. Use Descriptive Names: Make rule names clear and specific
  2. Set Appropriate Priorities: Higher priority for more specific rules
  3. Test in Development: Verify rules work before deploying to production
  4. Document Business Logic: Keep track of why each rule exists
  5. Regular Audits: Review and update rules periodically
  6. Use Consistent Naming: Stick to snake_case for field names
  7. Monitor Performance: Watch for rules that may need optimization

Troubleshooting

  1. Check if the rule is active
  2. Verify the user has the expected additional info fields
  3. Check field names match exactly (case-sensitive after normalization)
  4. Ensure all conditions in the rule match (AND logic)
  5. Check if a higher-priority rule might be overriding
  1. Verify JWT field mapping is configured correctly
  2. Check JWT actually contains the expected field
  3. Check the user’s additional info fields in SettingsUser ManagementUsers
  4. Ensure field name normalization is working correctly
  1. Check all active rules that might apply
  2. Remember rules are cumulative (user gets ALL matching permissions)
  3. Review priority settings
  4. Check for wildcard domain rules that might apply