auth0 / auth0-PHP

PHP SDK for Auth0 Authentication and Management APIs.
https://auth0.com/docs/libraries/auth0-php
MIT License
380 stars 209 forks source link

Invalid State Error after Upgrading from Auth0 PHP SDK v7 to v8 #770

Closed yrmallu closed 1 month ago

yrmallu commented 1 month ago

Checklist

SDK Version

8.7

PHP Version

PHP 8.2

Description

Hello Auth0 team,

I've encountered an issue after upgrading the Auth0 PHP SDK from version 7 to version 8. The error occurred within a WHMCS environment. Below are the details of the error I'm experiencing:

Error Message: [Mon Jul 22 14:53:57.433504 2024] [php:notice] [pid 1758830] [client 192.168.81.227:61846] [WHMCS Application] ERROR: Auth0\SDK\Exception\StateException: Invalid state in /var/www/html/whmcs/modules/addons/auth0/vendor/auth0/auth0-php/src/Exception/StateException.php:82 Stack trace: #0 /var/www/html/whmcs/modules/addons/auth0/vendor/auth0/auth0-php/src/Auth0.php(187): Auth0\SDK\Exception\StateException::invalidState() #1 /var/www/html/whmcs/sso.php(22): Auth0\SDK\Auth0->exchange() #2 {main} {"exception":"[object] (Auth0\SDK\Exception\StateException(code: 0): Invalid state at /var/www/html/whmcs/modules/addons/auth0/vendor/auth0/auth0-php/src/Exception/StateException.php:82)"}

Can you provide any guidance on what might be causing this issue and how to resolve it?

Thank you in advance for your help.

How can we reproduce this issue?

Steps to Reproduce:

  1. Upgraded from Auth0 PHP SDK v7 to v8.
  2. Encountered the error during the login process using Auth0's 'exchange' method in the WHMCS environment.

Expected Behavior: The expected behavior was that the login process would complete without errors, as it did in the previous version of the SDK.

Actual Behavior: An "Invalid State" error is thrown during the authentication flow, preventing the successful completion of the login process.

Environment:

evansims commented 1 month ago

Closing as this was answered over on the Auth0 Community.