Skip to content

Document OAuth token-endpoint error codes and statuses#1025

Merged
weppos merged 1 commit into
mainfrom
docs/oauth-token-error-codes
Jun 3, 2026
Merged

Document OAuth token-endpoint error codes and statuses#1025
weppos merged 1 commit into
mainfrom
docs/oauth-token-error-codes

Conversation

@weppos
Copy link
Copy Markdown
Member

@weppos weppos commented Jun 3, 2026

Summary

Documents the observable error-code and status changes to the OAuth token endpoint (POST /v2/oauth/access_token).

The error/status are:

  • invalid_grant (400): the authorization code is unknown or expired, or it was not issued to the supplied client_id (previously invalid_request / 400).
  • invalid_client (401): client authentication failed, for example an incorrect client_secret (previously invalid_request / 400; the 401 status is new for this endpoint).
  • invalid_request (400): unsupported grant_type, or a redirect_uri / state that does not match the authorization request (unchanged).

The 200 happy-path response is bit-identical, so no fixture changes were needed.

The token endpoint (POST /v2/oauth/access_token) now returns RFC 6749
aligned error codes and statuses on the failure paths:

- invalid_grant (400) for an unknown or expired code, or a client_id
  that does not match the grant.
- invalid_client (401) when client authentication fails, for example an
  incorrect client_secret.
- invalid_request (400) for an unsupported grant_type or a redirect_uri
  or state that does not match the authorization request.

Add an Error Responses section to the OAuth guide and a 401 response,
plus an updated 400 description, to the OpenAPI definition. The 200
happy path is unchanged.
@weppos weppos self-assigned this Jun 3, 2026
@weppos weppos added the documentation Updates on the documentation and support content. label Jun 3, 2026
@weppos weppos merged commit 234e410 into main Jun 3, 2026
8 checks passed
@weppos weppos deleted the docs/oauth-token-error-codes branch June 3, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Updates on the documentation and support content.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant