Player sessions
There is no login to implement. auth-token is the token your own site already
issued — you mint nothing new for us and we never store it.
What we do with it
We send it as the Bearer on {base}/profile and {base}/balance — see
Player profile and Balance. The
profile call is what authenticates it — its answer is who the player is; the
balance call answers only what they have.
You stay the only authority: a 401 or 403 on {base}/profile signs the
player out of the widget, so revoking is instant and needs no call to us. What
that looks like on your page is
sportsbook-session-expired — the
widget drops the token and, unless you cancel it, sends the page to /. The
profile URL is the only one that ends a session: refusing {base}/balance
tells us our own credentials are wrong, not that the player's are.
A 5xx or a timeout is not a refusal either: we answer the widget
"unavailable" rather than "unauthorized", so nobody is signed out while your
profile endpoint is having a bad minute.
The player you send
Identity is its own endpoint: Player profile. The field table, the refusal rules and the uniqueness rule are all there — this page covers the session token itself, not the identity it resolves to.
Which Bearer arrives on what
| Bearer | Operations |
|---|---|
| The player's own token | Anything the player started: confirming identity, reading a balance, placing a bet, requesting a cashout. |
| Your service key | Anything nobody started: settlement payouts, server-side cashouts, adjustments. There is no session, so the request names the player in playerId. |
The service key is long-lived, you issue it and you rotate it whenever you like — tell us when you do. We store it write-only. It also keys the signature on every call we make, player token or not — so the key your wallet holds and the one stored in the back-office must be the same bytes, or every player is refused.
Requirements
- Set
auth-tokenwhen the player signs in, remove it when they sign out. With no token the widget sends the page to/; cancel that default if you want an anonymous page — odds and fixtures, no balance, no bet slip. - Handle
sportsbook-session-expired, or accept its default: the page goes to/. - Answer
401or403on{base}/profileand{base}/balancealike to refuse a token, and never a200carrying a flag. Keep5xxfor your own failures: we read it as one. - Return all six required fields on every profile call,
firstnameandlastnameincluded, and sendexpiresAt— see Player profile for the field table and what an absentexpiresAtcosts you. - If you verify the signature, verify it with the key you handed us, and prove the pair with the back-office connection test before going live: a key that differs answers
401on every profile call, and that signs every player out.