I am trying to understand how error handling works when using Authorize [Authorize] Action Filter in MVC Preview 4.
I have an action that looks like this:
[Authorize(Roles = "DOMAIN\\NOTAUTHORISED_ROLE" )] [HandleError] public ActionResult NeedAuthorisation() { throw new NotImplementedException(); }
When I visit the URL: http://localhost:2197/testAuthorisation/NeedAuthorisation , I get a blank page in my browser. In Firebug, I see that a request has been made, and the status of the 401 - Unauthorised response 401 - Unauthorised . But I am not being redirected or returned a customError. Everything works as expected when using the role I am authorized to.
This is Windows authentication. I'm in the middle of writing code to try out forms authentication to see if I have the same problem. I set <customerrors mode="On"/> and created error pages, both in the testAuthorisation folder and in the shared folder.
Lewis Jan 29 '09 at 11:29 2009-01-29 11:29
source share