refreshAppToken
Rotate the calling app token for a fresh one (same app, extended TTL). Call before the current token expires to keep playing without signing in again. Allowed for app-scoped tokens; re-checks entitlement. The old token stays valid for about a minute more, or until its own expiry if that is sooner, and it ends when the new one signs out. IF THE ANSWER NEVER ARRIVES (a timeout, a connection that dropped), call again with the token you still hold: within that minute the answer is the same new token, not another one. After it the old token is refused and the player signs in again. WHERE TO SEND CALLS AFTERWARDS: applicationApiUrl in the answer. A refresh is answered with the address of the server that answered it while that server stays in service, so the address differs from the one in use only when that server is about to be removed (or the call came through the shared origin): use the address each refresh answers. NATIVE CLIENTS: pass currentServer (the ip4 + clientPort serverWithLeastClients gave you) and the new token is authorized on that same Buddy -- read authorizedServer on the response: when it is set, keep your UDP session and just switch tokens; when it is null, call serverWithLeastClients for a fresh placement. authorizedServer is null when the node is gone, draining, Full, on the wrong shard -- or when it is NearCapacity / running hot and a Ready sibling has room: a refresh is the cheapest moment to rebalance a resident, so expect to be moved occasionally under load. Without currentServer the new token is not known to any Buddy until you call serverWithLeastClients.
refreshAppToken(
currentServer: CurrentServerInput
): AppTokenResponse!
Arguments
refreshAppToken.currentServer ● CurrentServerInput input
The Buddy this client is connected to, so the refreshed token can be authorized there. Omit for browser (UDP-proxy) clients.
Type
AppTokenResponse object
A short-lived, app-scoped gameplay token (portal). Confined to a single app: usable only against that app's Application API + Buddy realtime surface (plus read-only me and same-app refreshAppToken). It CANNOT perform management operations and CANNOT mint tokens for other apps, so a game stack that receives it never gets the player's full identity session.