How it works
All Oshara REST endpoints used by third-party integrations authenticate with a JWT bearer token:Origin whitelisting instead (see Origin whitelisting below) so it can be called from the browser without exposing a token.
Getting a token
Sign up
Log in
| Token | Lifetime |
|---|---|
access | 10 days |
refresh | 30 days |
Refresh
Using the token
Include the access token in every authenticated request:Google OAuth
{access, refresh} JSON.
Current user
Origin whitelisting
The widget’s session-start endpoint checks theOrigin header of the browser request against the allowed_origins list on the AI character. Requests from non-whitelisted origins receive a 403 Forbidden.
Configure allowed origins in the dashboard under Characters → [character] → Allowed Origins, or via the Characters API.
https://mysite.com allows all pages under that domain.
Origin checking is skipped when
DEBUG=True on a self-hosted backend to simplify local development.