Token refreshing failure - use error_description property #86
Unanswered
PrzemyslawMucha
asked this question in
IdentityServer
Replies: 1 comment 4 replies
-
We are deliberately vague with error responses. We don't want to volunteer too much information to attackers. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
IdentityServer version
7.1
.NET version
8
Description
When token refreshing ends with failure, we always got only generic error response as {"error": "invalid_grant"}. OAuth 2.0 standard allows use optional error_description property (https://datatracker.ietf.org/doc/html/rfc6749#section-5.2).
It's possible to overrite DefaultRefreshTokenService (https://github.com/DuendeSoftware/products/blob/main/identity-server/src/IdentityServer/Services/Default/DefaultRefreshTokenService.cs#L79) to add error_description information.
But TokenRequestValidator (https://github.com/DuendeSoftware/products/blob/main/identity-server/src/IdentityServer/Validation/Default/TokenRequestValidator.cs) implementation is internal, hard to ovverride, and whatmore, it does not use error data from IRefreshTokenService (https://github.com/DuendeSoftware/products/blob/main/identity-server/src/IdentityServer/Validation/Default/TokenRequestValidator.cs#L695).
I can see two solutions:
Reproduction steps
No response
Expected behavior
No response
Logs
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions