Auth Tokens API
The Platform Auth Tokens API creates short-lived tokens for anonymous external search, so a browser can search without a Glean user.
Use Cases
Anonymous Search
Give the Web SDK, or another browser client, a token for anonymous external search.
Short-Lived Browser Tokens
Create tokens on your backend and pass them to the browser. Each token acts as no user and expires at its expires_at time.
API Endpoints
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /api/anonymous-auth-tokensBeta | Create an anonymous auth token |
Call this endpoint from your backend, never from the browser. It needs an API token that has anonymous permissions and the anonymous_auth_tokens:write scope. Any other caller gets a 403, and so does a deployment where anonymous external search is off.
To pass the token to the Web SDK, see token-based authentication.
This endpoint is in beta. Send X-Glean-Include-Experimental: true on each request, or it is not exposed.
For error responses, see Platform API Errors for the shared ProblemDetail code reference and remediation guidance.