c# - Preventing Cross-Site Request Forgery (CSRF) Attacks -


i've read below link , understand except 1 part. asked question in comment on link, nobody responded.

http://www.asp.net/web-api/overview/security/preventing-cross-site-request-forgery-(csrf)-attacks

where call "validaterequestheader"?

can please able answer this?

depends if using mvc or webapi validate request.

for web api put in message handler.

and mvc put in action filter.

that way request validated before reaches controller's action method , since cross cutting concern can applied controller or action decorating attribute.

mvc has [validateantiforgerytoken] attribute built. think webapi need handroll own.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -