Do not add AuthorizationAttribute on your action method where ever you do not required for example.
My custom attribute
public class AuthorizationFilterAttribute : AuthorizeAttribute
{
// Some code...
}
My controller
public class UserController : BaseController, IDisposable
{
[AuthorizationFilterAttribute]
public ActionResult UserList()
{
// Authorize attribute will call when this action is executed
}
public ActionResult AddUser()
{
// Authorize attribute will not call when this action is executed
}
}
I hope you got my point what I am trying to say you.
Simply add the attribute to the Actions you want to filter, and not on the controller class. By not decorating actions, they will not be filtered, provided the controller or one of its base controllers hasn't got the attribute.
I just did a solution using Azure ACS as the federated Identity Provider and the accepted answer didn't work for me. For those who are struggling, my solution was to bypass the security altogether for the required controller/views.
Create a new Controller/Views for those actions which you need to bypass the authorization.