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.
968 questions
0 comments No comments
{count} votes

Accepted answer
  1. suvasara-MSFT 10,011 Reputation points
    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.


0 additional answers

Sort by: Most helpful