Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

AuthorizeResult and ErrorMessage discard the ErrorDescription in AuthorizeResponse #965

Closed
mackie1001 opened this issue Mar 22, 2017 · 3 comments
Assignees
Milestone

Comments

@mackie1001
Copy link

I have a requirement to perform additional validation on authorize endpoint requests to enforce a policy around 2FA use. As part of this I need to present a friendly message to the end user. ICustomAuthorizeRequestValidator is great and allows me to do exactly what I want, including specifying an ErrorDescription in the returned result. However when this reaches AuthorizeResult.RedirectToErrorPageAsync() it does not pass/persist the ErrorDescription property.
Could I possibly request that you add support for this to IdentityServer4.Models.ErrorMessage and IdentityServer4.Endpoints.Results.AuthorizeResult please?

@brockallen
Copy link
Member

Ok, done.

@mackie1001
Copy link
Author

mackie1001 commented Jun 27, 2017

This appears to still be an issue. If I set AuthorizeRequestValidationResult.ErrorDescription in my ICustomAuthorizeRequestValidator even the TokenIssuedFailureEvent raised immediately after the call to ValidateAsync() does not include the description. It does not get picked up when I call IIdentityServerInteractionService.GetErrorContextAsync() either.

It looks like this is the culprit in AuthorizeRequestValidator:

            if (customResult.IsError)
            {
                LogError("Error in custom validation: " + customResult.Error, request);
                return Invalid(request, customResult.Error);
            }

The call to Invalid() is not passing the ErrorDescription from customResult.

Unfortunately that class and its interface are internal so I'm not able to replace it with my own implementation.

@lock
Copy link

lock bot commented Jan 14, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants