Windows Authentication - Configure AccessDeniedPath
When an authorization policy fails a completely blank page is returned when using windows auth. With other authentication options, like cookie authentication, one can configure an AccessDeniedPath to redirect a user too in this scenario. What is the equivalent for windows authentication? The documentation seems to gloss over this detail.
@HaoK Any ideas? Is something lacking in that doc?
@Tratcher what are people supposed to do when windows auth fails?
I think they probably can just do the equivalent manually... check for authZ failure, and redirect to the "AccessDeniedPage". Sound reasonable @blowdart ?
I presume you're getting a 403 status? I'm not sure what Windows auth would do at this point to be honest, but yea a redirect works.
You could use the StatusCode middleware to provide content. I don't recommend redirecting, you'd loose the protocol 401/403 semantics.
Ah, I didn't mean redirect as in HTTP redirect :) I figured some magical inline redirect
Ah, yeah, the StatusCodes middleware will do that for you.
Yes, I am getting 403 status. I was able to configure the StatusCodePages middleware to add the desired error pages. I do feel like this needs to be noted in the documentation somewhere, even just a link to the StatusCodePages middleware. Otherwise the documentation feels incomplete.