Files
meet/docs
briquet d65ac8c845 🐛(backend) return RFC 6749 errors from application token endpoint
The application token endpoint implements the client credentials
grant (RFC 6749 section 4.4), but its errors did not follow section
5.2: serializer errors were keyed by field, and the other errors used
either `detail` or a free-text `error`. Standard OAuth 2.0 client
libraries could not parse them.

Every error is now rendered as
`{"error": <code>, "error_description": <text>}` by a view-specific
exception handler:

- missing or blank client credentials and wrong credentials or
  inactive applications return `invalid_client`
- an unsupported grant type returns `unsupported_grant_type`
- an invalid email, a denied domain or an unknown user return
  `invalid_scope`;
- the provisional user creation conflict returns `server_error`,
  since the RFC defines no code for server-side failures here
- any other error returns `invalid_request`.

Serializer errors are flattened into one description listing every
invalid field. Descriptions are restricted to the characters allowed
by the RFC, as DRF messages may be translated or contain quotes.
2026-10-21 21:37:36 +02:00
..
2026-03-18 10:24:09 +01:00