Consider an ASP.NET MVC application using the Salt parameter in the [ValidateAntiForgeryToken] directive.
The scenario is that the application will be used by many clients. It is not very desirable to have Salt at compile time.
The current strategy is to find the Salt value in the web.config file.
[ValidateAntiForgeryToken(Salt = Config.AppSalt)]
This throws an exception at compile time, assuming that the Salt value must be const at compile time.
The attribute argument must be a constant expression, a typeof expression, or an array creation expression type attribute attribute
How can I change the application to allow Salt to load at runtime so that the application does not need to be re-salted and recompiled for each client?
Please note that Salt will not change often, if at all, thereby eliminating the possibility of form cancellation
asp.net-mvc salt csrf
p.campbell Jun 08 2018-10-06T00: 00Z
source share