Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure /oauth/token endpoint returns OAuth 2 conformant errors #49

Open
ThisIsMissEm opened this issue Oct 23, 2024 · 2 comments
Open

Comments

@ThisIsMissEm
Copy link
Contributor

Currently it can return Zod errors for request input validation, per #47 (comment)

Example response:

{
  "error": "Invalid request",
  "zod_error": {
    "issues": [
      {
        "expected": "'authorization_code' | 'client_credentials'",
        "received": "undefined",
        "code": "invalid_type",
        "path": [
          "grant_type"
        ],
        "message": "Required"
      }
    ],
    "name": "ZodError"
  }
}

Doesn't conform to:

interface ErrorResponse {
  error: string;
  error_description?: string;
  error_uri?: string;
}

Per https://datatracker.ietf.org/doc/html/rfc6749#section-5.2

@ThisIsMissEm
Copy link
Contributor Author

So for OAuth endpoints we may not be able to validate via Zod?

@dahlia
Copy link
Owner

dahlia commented Oct 24, 2024

We may not be able to utilize zValidator(), but we would be able to manually call Zod in the handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants