I'd like to obtain anti-forgery token value in ASP .NET MVC project. I have investigated the HtmlHelper.AntiForgeryToken
helper method only to find that it uses the AntiForgery
class which provides public method GetHtml
used by the aforementioned helper. The problem is this method only returns the HTML of the entire hidden form input field represented by HtmlString
. I'd like to get my hand on the name of the field and its value, which I am able to do now parsing the returned HtmlString
, but not in any clear way. Everything useful (like IAntiForgeryConfig
implementation for the field name) is internal. Is there any other facet of the MVC infrastructure that I am not aware of that offers public members allowing the access to the form field name and value rather that the serialized values?
0
votes