Skip to main content
End users who chat through the embedded widget or a custom interface built on the SDK API don’t sign in to AGO. AGO identifies each of them with:
  1. A user identifier sent in the X-User-Anon-Id header. The widget generates it in the visitor’s browser and keeps it in localStorage under ago-widget-id, so a returning visitor keeps their conversations. It must be 1 to 64 characters long and contain only letters, digits, - and _ (a UUID works). X-Widget-Id is still accepted as the former name of this header.
  2. The website’s origin, checked against your allowed domains list.
  3. An optional JWT issued by your application, to identify logged-in users.
AGO creates the end user automatically on their first request.

Configure the widget

Go to Support > Settings > Your channels > Widget & SDK, then fill in Widget Configuration: Anonymous and logged-in users can get different permissions. Set the defaults for each in Agents > Permissions. See Agent Permissions.

Anonymous users

Anonymous access needs no extra setup: embed the widget and each visitor gets their own identifier.
Copy the exact basepath for your workspace from the integration examples on the Widget & SDK page.

Logged-in users (JWT)

To identify users who are logged in to your application, issue a JWT for them and pass it to the widget:
The widget sends the token in the Authorization: Bearer <token> header of every request. When the token changes, for example after a refresh or a login, call sendJwtToAGO(token). See Widget Metadata Communication.
Authentication Flow with JWT

Authentication Flow with JWT

Token requirements

  • Sign the token with RS256, RS384, RS512 or ES256, using a key published at your JWKS URL.
  • Set an exp claim to limit the token’s lifetime. AGO rejects expired tokens.
  • AGO reads these claims when present:
Other claims are kept on the user, so you can show them with JWT Fields Mapping or use them in access control rules. If AGO can’t verify the token (wrong signing key, expired, or no JWKS URL configured), the user is treated as anonymous.

Request headers

The widget sets these headers for you. If you call the SDK API directly, send them yourself:
On the SDK API, a verified JWT is enough on its own: the X-User-Anon-Id header becomes optional and AGO uses the token’s sub claim as the user’s identity.

Troubleshooting

The widget doesn’t load or returns “Not authorized”
  • Check that your website’s domain is in Allowed Domains.
  • Check that the X-User-Anon-Id header is present and only contains letters, digits, - and _, or that a JWT is sent on the SDK API.
Logged-in users appear as anonymous
  • Check that the JWT JWKS URL is set and reachable from the internet.
  • Check that the token is signed with a key published at that URL and with a supported algorithm.
  • Check that the token hasn’t expired.