token_signature_invalid: The browser token was altered
The token has the right shape and kind, but its signature does not match its id. The token was changed after it was minted (for example, characters in its last part were edited or lost), or it was minted by another deployment. Widget routes, budget links, the portal and the top-up page all answer this code.
On the multi-tenant hosted tier the front door looks up which account minted the token by its id before anything else. A token whose id part was changed, or one minted by another deployment, is unknown there and answers token_revoked with the front door's own body; only a token whose id is known but whose signature part was changed reaches the account's core and answers token_signature_invalid.
What to do
- End users: open the link exactly as the service sent it, or ask for a new one.
- Developers: pass the token exactly as minted (do not trim, re-encode or rebuild it), or mint a new one. See token codes.
On the wire
HTTP 401, error type authentication_error. The widget routes always answer JSON; the budget link, portal and top-up pages answer a short HTML page naming the code, or JSON to a client that sends Accept: application/json (and not text/html):
{
"error": "unauthorized",
"errorDetail": {
"type": "authentication_error",
"code": "token_signature_invalid",
"message": "the token signature does not verify",
"param": null,
"doc_url": "…/developers/widgets.md#token-signature-invalid",
"fix": "the token was altered; mint a new one"
}
}
The top-up page points doc_url at the top-up guide instead. See all error codes.