RockSolidKnowledge / TokenExchange

Token Exchange (RFC 8693) implementation for IdentityServer
Apache License 2.0
17 stars 0 forks source link

Visible TokenExchangeRequestValidator fail message #2

Open EgorTarasovSecurrency opened 2 years ago

EgorTarasovSecurrency commented 2 years ago

Currently, TokenExchangeRequestValidator fail message is effectively lost since it is exchanged to the generic message https://github.com/RockSolidKnowledge/TokenExchange/blob/b999e7738f2b6fd7ee5fa4eebabc9dde6d73748b/src/Rsk.TokenExchange.IdentityServer4/TokenExchangeExtensionGrantValidator.cs#L70

It would be nice to make the error description visible. Perhaps, something like that:

context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, $"Invalid subject token - {validationResult.ErrorDescription}"); 

If you will accept PRs on the change, please let me know