Authentication
Web origins
Which web pages may call the browser ingest routes.
Browsers send a page's origin with every cross-origin call. Sapagan answers browser calls only from origins the workspace lists. A call from another origin is refused with 403 origin_not_allowed and no CORS header, so the page cannot read even the refusal. The SDK sees a network error.
Set the list#
An owner sets the list at Settings, Setup, "Web origins", or with PUT /v1/setup/web-origins from an owner's console session. That route is for the console and is not part of the public reference.
The rules#
- An origin is
scheme://host[:port], for examplehttps://app.example.com. No path. - No wildcard subdomains.
- At most 50 origins.
- A production workspace needs a list, and every origin must be
https. - A development workspace may give
["*"]to allow any origin, and may listhttporigins such ashttp://localhost:3000. - An empty list lets no browser in.
The change is audited as web_origins_update.
What it covers#
The origin check applies to the two routes a page calls with a public key: POST /v1/batch and POST /v1/push/opened. No other route answers a browser's cross-origin preflight. Calls from servers send no Origin header and are not affected.
An origin is not a credential. A script outside a browser can send any Origin. The list stops other sites' pages from using your key from their visitors' browsers. Identity tokens protect the person.