Top "Authorize-attribute" questions

Asp.net MVC4: Authorize on both controller and action

If I have the Authorize attribute on both the controller and the action, which one will take the effect? Or …

asp.net-mvc authorize-attribute
Handling session timeout in ajax calls

I'm making an ajax call using jquery to an asp.net mvc controller action: [AcceptVerbs(HttpVerbs.Post)] public ActionResult GetWeek(…

asp.net-mvc asp.net-mvc-3 jquery authorize-attribute
Get ActionName, ControllerName and AreaName and pass it in ActionFilter Attribute

I use a custom AuthorizationFilter like the followings: public class ActionAuthorizeAttribute : AuthorizeAttribute { protected override bool AuthorizeCore(System.Web.HttpContextBase httpContext) { …

asp.net-mvc asp.net-mvc-3 authorization action-filter authorize-attribute
Dynamically add roles to authorize attribute for controller

I need to enable my admin user to change access permissions for users on the fly, such that they can …

c# asp.net asp.net-mvc asp.net-identity authorize-attribute
Get list of custom attributes for current action/controller in ASP.NET MVC

Checking out the sample code from http://lukesampson.com/post/471548689/entering-and-exiting-https-with-asp-net-mvc written for ASP.NET MVC2, I noticed they can …

asp.net-mvc custom-attributes authorize-attribute
Action filter execution order

I have created two classes that implement AuthorizeAttribute. One is used globally, and I set it on the Global.asax.…

asp.net-mvc asp.net-mvc-3 action-filter authorize-attribute
How to return custom message if Authorize fails in WebAPI

In my WebAPI project, I have number of apis which are decorated with [Authorize] attribute. [Authorize] public HttpResponseMessage GetCustomers() { //my …

c# asp.net-web-api owin authorize-attribute
Creating Custom AuthorizeAttribute in Web API (.Net Framework)

I'm using OAuth2.0 Owin (password grant) in my WebAPI.My initial token Response is like below { "access_token": "_ramSlQYasdsRTWEWew.....................", "token_…

c# oauth-2.0 asp.net-web-api2 authorize-attribute
MVC Core How to force / set global authorization for all actions?

How to force / set global authorization for all actions in MVC Core ? I know how to register global filters - …

asp.net-core-mvc authorize-attribute asp.net-authorization
Custom AuthorizeAttribute with custom authentication

I am using ASP.NET MVC 4 Web application as a front-end for some WCF services. All the user log in/…

asp.net-mvc authorize-attribute custom-authentication