The X-CSRF-Signature header could not be validated.

Bee 1 Reputation point
2021-04-05T17:52:25.99+00:00

Hi,

I am following https://learn.microsoft.com/en-us/learn/modules/azure-database-fundamentals/exercise-create-sql-database this tutorial.

When I am trying to log in to db1 using query editor using username and password I get an error message - The X-CSRF-Signature header could not be validated.

I have proxy set to default and TLS is off but still I am getting this error.

any clue?

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2021-04-05T23:38:23.113+00:00

    One way to address this is to change your connection mode from Proxy to Redirect. Please the following: Change Azure SQL Database connection policy.The issue hinges on a 3rd party proxy server that is handling your connectivity (corporate firewall) and is causing the exception. The solution is to change from Proxy mode to Redirect mode.

    For error messages relating to the “X-CSRF-Signature header” validation -

    This header is created and validated to prevent a certain type of attack against your Azure SQL Servers. Specifically, some web browsers can save your passwords which might then allow an attacker who doesn’t know the password to issue queries using the remembered password. In order to prevent this type of attack, known as Cross Site Request Forgery (CSRF), we attach this little bit of extra data, called the “CSRF Signature”. This signature proves that the credentials were known at the time of the request, not just remembered by the browser.

    This security mechanism requires that your clocks are synchronized to within 5 minutes of our servers, to prevent replay attacks with old CSRF signatures.

    Please ensure that your clock is set to the correct time, as this is the most likely cause for the error message you observed.

    Please make sue that your client and/or proxy is not causing a timestamp issue. The proxy would come into play when attempting to connect from the workplace. If you could try to connect from home or from outside your workplace LAN.

    7 people found this answer helpful.

Your answer

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