vendredi 22 mars 2019

How to keep a consistent RequestVerificationToken in every run in .Net Core web apps

I know in .Net Core html forms an anti forgery token or something is automatically generated in a similar form like below:

<input name="__RequestVerificationToken" type="hidden" value="CfDJ8KEf24u6Lm9Kv91DDeHZwskS27e4FhK4R1qbdP-wkrXxFFVMoPzUDY5dAJ3Mf63GkB6ZgTNOEe0TKNi4kFJoQaZ7CMoqQoBrzlheq69YP3OY29oYz6VGKAt3KCl2CFfIajrbWf05hi2Oj1fwnmGcxys" /></form>

For the purpose of some snapshot testings, I need to have a way to make sure this token stays exactly the same every time the form page is loaded. The security is not a factor here, since as I said I need this only for the purpose of snapshop testings.

Is there a way to manipulate this token to make sure it keeps a constant value all the time?

Aucun commentaire:

Enregistrer un commentaire