Cisco AnyConnect Generates CSRF Token Mismatch Error During Auth0 SAML Login.

Overview

Cisco AnyConnect generates a CSRF token mismatch error after an authentication attempt via Auth0 SAML. This occurs because the Cisco ASA cannot match the SAML response to the original VPN session cookie due to embedded browser cookie handling, a mismatched callback URL, or dropped RelayState bindings. Configure AnyConnect to use the default operating system browser, verify the callback URL, and check the SAML addon settings to resolve the issue.

Applies To

  • Auth0
  • SAML2 Web App Addon
  • Cisco AnyConnect

Cause

The error occurs because the Cisco ASA receives the successful SAML login response from Auth0 but cannot match it to the original VPN session cookie. This mismatch happens when the AnyConnect embedded browser drops modern session cookies, the Auth0 Callback URL contains an incorrect Fully Qualified Domain Name (FQDN) or Tunnel Group, or the SAML addon configuration drops the RelayState parameter.

Solution

How is the CSRF token mismatch error resolved in Cisco AnyConnect?

To resolve the CSRF token mismatch error, configure the VPN client to use the default operating system browser, verify the callback URL, and check the SAML addon settings by following these steps:

  1. Configure Cisco AnyConnect to use the default operating system browser (for example, Chrome, Edge, Safari) instead of the embedded mini-browser to ensure the client retains modern session cookies.
  2. Navigate to the Auth0 Dashboard.
  3. Choose Applications and select Applications.
  4. Select the Cisco AnyConnect application.
  5. Select the Addons tab and choose SAML2 Web App.
  6. Verify the Application Callback URL perfectly matches the Cisco ASA Fully Qualified Domain Name (FQDN) and explicitly includes the target Tunnel Group parameter.
  7. Scroll to the Settings JSON block in the SAML2 Web App configuration window.
  8. Ensure the configuration does not explicitly disable bindings or override the default RelayState behavior.
  9. Select Save to apply the changes.

Recommended content

No recommended content found...