Skip to content

Consider enhancing OAuth2Error with specific error codes #1240

@Yneth

Description

@Yneth

Expected Behavior
I want to have the option to override OAuth2 Error codes that are thrown from the spring-authorization-server source code.

Current Behavior
I am not able to override default OAuth2 Error codes.

Context
In our project, we want to provide more meaningful error codes to clients, as sometimes the standard OAuth2 error codes are too vague, such as invalid_grant. In our client's code, we want to have specific error codes for each problem so that they can handle each case differently.

We can currently map error codes by parsing the error_description, but we want to avoid that.

It would be amazing if we had either more
(A) detailed error codes or
(B) an additional internal list of error codes that would allow for more precise usage.

I understand it could violate RFC but we are ok with that.

Example
Option A:
instead of just invalid_request say missing_client_id

Option B:
send both invalid_request and missing_client_id

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions