Application Gateway CSRF Token Error: Valid CSRF Token Required

Mohit Kumar Sharma 86 Reputation points
2021-04-22T05:27:05.803+00:00

Hi All,

I have a Php website and it is hosted on the azure web app. It is also working fine. But when I am using it through the application gateway I am getting a CSRF token error on the login page. Can you help me please?

Thanks
Mohit Sharma

Azure Application Gateway
Azure Application Gateway

An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.

0 comments No comments

Answer accepted by question author
suvasara-MSFT 10,171 Reputation points Moderator
2021-04-22T13:13:08.303+00:00

@Mohit Kumar Sharma , I did test it locally and looks CSRF token has been transferred without any error.

My setup:

  1. Azure WebAPP with PHP (7.4)
  2. A sample PHP application with basic CSRF session module.
  3. Custom domain added to Azure WebApp with no binding.
  4. Azure Application gateway standard V2.

Generate-token.php
90401-generate-token.log

verifytoken.php
90259-verifytoken.log

Let us know what framework are you using here for implementing CSRF protection.

----------

Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.