Prerequisites
- A Microsoft Entra ID tenant (Azure AD)
- Admin access to create app registrations
- Access to the Char dashboard
Quick Links
Azure Portal
App registrations in Azure Portal
Entra Admin Center
Microsoft Entra Admin Center
Microsoft Docs
Register an application quickstart
ID Token Claims
Token claims reference
SDK References
@azure/msal-browser
Microsoft Authentication Library for Browser
@azure/msal-react
MSAL React wrapper library
Configuration Steps
Register an Application in Azure
- Sign in to the Azure Portal or Entra Admin Center
- Navigate to Microsoft Entra ID → App registrations
- Click New registration
- Configure the registration:
| Setting | Value |
|---|---|
| Name | Char Agent (or your preferred name) |
| Supported account types | Choose based on your needs (typically “Single tenant”) |
| Redirect URI | Select “Single-page application (SPA)” and enter your callback URL |
- Click Register
Note Your Application (Client) ID and Tenant ID
After registration, from the Overview page, copy:
- Application (client) ID - This is your Client ID
- Directory (tenant) ID - This is your Tenant ID (used as the domain in Char)
See Microsoft’s app registration guide for screenshots showing exactly where to find these values.
Configure Authentication Settings
Navigate to Authentication in your app registration:
- Under Single-page application, verify your redirect URIs
- Under Implicit grant and hybrid flows, ensure ID tokens is checked
- Click Save
Configure Char
In the Char Dashboard:
- Navigate to Settings → Integration
- Under SSO Configuration, select Azure AD as the provider
- Enter your Application (client) ID as the Client ID
- Enter your Directory (tenant) ID as the Tenant ID
- Click Test Connection to verify
- Click Save Changes
Configuration Reference
| Char Field | Azure Value | Example |
|---|---|---|
| Provider Type | Azure AD | azure |
| Client ID | Application (client) ID | 12345678-1234-1234-1234-123456789012 |
| Tenant ID | Directory (tenant) ID | 87654321-4321-4321-4321-210987654321 |
You can also use your verified domain name instead of the Tenant ID (e.g.,
contoso.onmicrosoft.com or a custom domain like contoso.com).Token Requirements
Char validates Azure AD tokens with these requirements:| Claim | Requirement |
|---|---|
iss | Must match https://login.microsoftonline.com/{tenant-id}/v2.0 |
aud | Must include your configured Application (client) ID |
sub | Required - used as the user identifier |
exp | Must not be expired |
Example: Obtaining and Passing the Token
- MSAL.js (Browser)
- React (MSAL React)
- SSR (Ticket Exchange)
Multi-Tenant Configuration
If your application supports multiple Azure AD tenants:- Register your app with Accounts in any organizational directory
- Use the
commonororganizationsauthority endpoint - Configure Char with your specific tenant ID where you want to validate tokens
Troubleshooting
INVALID_ISSUER error
INVALID_ISSUER error
The token issuer doesn’t match your configured tenant:
- Verify the Tenant ID in Char matches your Azure AD directory
- Check that you’re using the v2.0 endpoint (MSAL uses this by default)
- For multi-tenant apps, ensure you’ve configured the correct tenant
INVALID_AUDIENCE error
INVALID_AUDIENCE error
The token’s
aud claim doesn’t match your configured Client ID:- Ensure the Client ID matches your Application (client) ID exactly
- Verify you’re using the ID token, not the access token
- Check that your app registration has the correct redirect URI type (SPA)
JWKS_FETCH_FAILED error
JWKS_FETCH_FAILED error
Char couldn’t reach Azure’s JWKS endpoint:
- Verify your Tenant ID is correct
- Check network connectivity to
login.microsoftonline.com - Use Test Connection in the dashboard to verify
Token acquisition fails silently
Token acquisition fails silently
If
acquireTokenSilent fails:- Ensure the user has previously authenticated interactively
- Check that your scopes include
openid - Verify the redirect URI matches your app registration
- Try
acquireTokenPopuporacquireTokenRedirectas a fallback
Security Best Practices
- Use
connect()for authentication - Theconnect({ idToken, clientId })method keeps tokens out of the DOM - Use ticket exchange for SSR - For server-rendered pages, exchange Azure AD JWTs for short-lived tickets server-side
- Use single-tenant configuration unless you specifically need multi-tenant support
- Enable Conditional Access policies in Azure AD for additional security controls
- Configure token lifetime appropriately in Azure AD
- Monitor sign-in logs in Azure AD for suspicious activity
- Regularly review app permissions and remove unnecessary scopes

