• BNavin118206 (Community Member)

      Hi Hemanth,I am using standard java script,just explain how can I add token in JSP page and how to validate the token at server side.​

  • HemantShah (Community Member)

    Hi @BNavin118206 (Community Member)​ ,

     

    If you are using .NET MVC, then it is pretty much simple, you need to use HTML helper @Html.AntiForgeryToken() in view. It should be placed inside the BeginForm() method in your view and then we need to add [ValidateAntiForgeryToken] attribute on the action method which will accept HTTP POST request. We need to do only these 2 changes and then MVC will prevent from CSRF attacks.

     

    Hope this helps you. If you are using different technology stack then please describe. what you are using.

     

    Thank you

    Hemant

    Expand Post
  • BNavin118206 (Community Member)

    How to validate csrf token ​in server side means in java file

Topics (4)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.