csrf_invalid: The request did not come from this deployment's own page
Three places answer this code:
- A payment (
POST /owner/v1/human/payments) was made with a console session, and itsOrigin(orReferer) header does not match this deployment's host, or is missing. A request the multi-tenant front door forwards has already had its session CSRF token checked and skips this check; the front door answers a missing or wrong session CSRF token itself, withcsrfinstead of this code. Nothing was paid (fail closed). - The hosted top-up form (
POST /pay/topup/{token}) was sent from another origin (or with noOriginorReferer), without a valid body, or without the form's own hiddencsrfvalue. Nothing was charged. - An end-user portal freeze or revoke (
POST /portal/{token}/streams/{id}/freezeor/revoke) was sent from another origin, without a valid body, or without the page's own hiddencsrfvalue. Nothing changed. On a multi-tenant (hosted) deployment the front door forwards these forms to the core that minted the portal token, which runs the same checks.
What to do
- Pay from the console page served by this deployment (
/console, People and payments), not from a copy or another site. - Use the top-up and portal pages exactly as the deployment serves them; reload the page and submit its own form again.
- Scripts should use an API key or the owner token instead of a session cookie.
On the wire
HTTP 403. On the human payment route the error type is authentication_error:
{
"error": "unauthorized",
"errorDetail": {
"type": "authentication_error",
"code": "csrf_invalid",
"message": "the change did not come from this deployment's console (fail closed)",
"param": null,
"doc_url": "…/developers/human-payments.md#csrf-invalid",
"fix": "send the change from the console page served by this deployment"
}
}
The human payment routes point doc_url at the matching section of the human payments guide. The top-up and portal pages answer an HTML page naming the code, or, to a client that asks for JSON, error: "state" with error type state_error. See all error codes.