c# - asp.net mvc5 custom authorization on HttpPost -


if httpget action method has authorization filter, corresponding httppost need 1 well? httppost action method protected validateantiforgerytoken , data bind. user must authenticated via ldap.

[httpget] [customauthorization("admin", "user")] public viewresult mymethod(){}   [httppost] [validateantiforgerytoken] public actionresult mymethod([bind(include = "vars")] model model){} 

the filter attribute have works on method. not have affect on other methods. can put attribute on class well, affect of methods (at least ordinary authorize attribute works way, it's case 1 well).

validateantiforgerytoken nothing authentication. verifies token html equal token cookie. can read more it, protect against csrf attack, not authenticate users.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -