ASP.Net MVC Authorisation action filter -


4.

I have a task that looks like this:

  [authorize (roles = "DOMAIN \\ NOTAUTHORISED_ROLE")] [handler] Public action required authorization () {Throwing a new notified exception); }  

When I go to url: http: // localhost: 2197 / testAuthorisation / need AUuthorization , I get a blank page in my browser. In Firebug I can see that a request was made and the response status of 401 - unauthorized has been returned but I am not being redirected or the error has returned when custom. Which works as expected while using such a role, for which I am authorized.

This is using Windows authentication. I am in the middle of writing some code to see the form authentication to get the same issue. I have & lt; Customerrors mode = "on" /> is set and you have created error pages in both testAuthorisation folder and shared folder.

What really happens when you start a controller action without the right permissions If you use the ASP .NET development server, by default, you get a blank page depending on the type of authentication. The page is served with 401 authorized HT Response Status.


Comments