# Authenticate consumers
Advanced feature
To authenticate consumers in your Zoom Contact Center or Zoom Virtual Agent experience, use Consumer Authentication. Consumer Authentication uses JSON Web Tokens (JWT) to verify consumer identity and provide personalized experiences based on authenticated customer data.
Consumer Authentication is separate from passing front end data. For contextual data without authentication, see [Pass front end data](/docs/zcx/pass-frontend-data).
## Requirements
To implement consumer authentication, you need:
- A JWT endpoint that generates tokens signed with ES256 algorithm
- A public/private key pair for ES256 signing
- The Contact Center or Virtual Agent portal configured by an admin
- A verified domain for single-domain implementation
## Single domain implementation
For a single domain, add the `data-auth-endpoint` attribute to your Zoom Customer Experience SDK for web script.
```html
```
When the SDK loads, it calls your authentication endpoint. Your endpoint must return a JWT signed with ES256.
### JWT response format
Your authentication endpoint should return the following JSON response.
```json
{
"token": "eyJhbGciOiJFUzI1..."
}
```
The JWT payload should contain claims configured in your Contact Center or Virtual Agent Global Variables.
## Multi-domain implementation
For multi-domain support, add this configuration before your SDK script loads to override the authentication credential function.
```javascript
window.zoomCampaignSdkConfig = {
getAuthCredentials: async () => {
const response = await fetch("https://yoursite.com/api/auth/jwt");
const data = await response.json();
return data.token;
},
};
```
The SDK calls `getAuthCredentials()` to retrieve the JWT.
## JWT signing
Your authentication endpoint must sign JWTs with the ES256 algorithm. Generate an ES256 key pair and configure the public key in your Contact Center or Virtual Agent portal.
The following are example JWT claims.
```json
{
"sub": "customer_12345",
"email": "customer@example.com",
"tier": "premium",
"iat": 1679500000,
"exp": 1679503600
}
```
Map these claims to Global Variables in the portal to use them in flows.
## Testing
To verify consumer authentication:
1. Load your website with the SDK script.
2. Open browser developer tools and check the Network tab for the authentication request.
3. Verify the JWT is generated and passed to the SDK.
4. Test that Global Variables populate correctly in your flows.