I removed composer.lock and vendor and installed composer freshly but still getting the same error.
The error is coming on $auth0->exchange()
The error still being the one you posted above about the GuzzleHttp issue, correct?
That makes sense since exchange() opens and establishes a network connection, but we donāt include any hard dependencies, so Guzzle isnāt coming from our end. The SDK will use whatever is available within your project.
Can you share the contents of your composer.json here? Maybe we can spot something amiss there.
Ah, I guess it must be php-http/discovery causing it to be installed. Iāve never seen it cause issues quite like that, but I donāt recommend using it, anyway.
Go ahead and set php-http/discovery to false in your composer.json. Then repeat deleting your composer.lock file and vendor subdirectory, and then try re-running composer install. That should take care of that Guzzle error, at least.
Next, the SDK requires PSR-7, PSR-17, and PSR-18 dependencies for creating, sending, and handling network requests.
TypeError: Auth0\SDK\Configuration\SdkConfiguration::__construct(): Argument #20 ($httpClient) must be of type ?Psr\Http\Client\ClientInterface, Buzz\Client\MultiCurl given, called in /var/www/html/whmcs/modules/addons/auth0/auth0.php on line 116 and defined in /var/www/html/whmcs/modules/addons/auth0/vendor/auth0/auth0-php/src/Configuration/SdkConfiguration.php:116
Stack trace:
other wise
Whoops\Exception\ErrorException: Declaration of GuzzleHttp\Psr7\Request::getRequestTarget() must be compatible with Psr\Http\Message\RequestInterface::getRequestTarget(): string in /var/www/html/whmcs/vendor/guzzlehttp/psr7/src/Request.php:58
Stack trace:
#0 /var/www/html/whmcs/vendor/whmcs/whmcs-foundation/lib/Utility/Error/Run.php(0): WHMCS\Utility\Error\Run->handleError()
#1 [internal function]: WHMCS\Utility\Error\Run->handleShutdown()
#2 {main}
Internally, our SDK uses psr-discovery/http-client-implementations to discover available PSR-18 dependencies in your project without requiring you to configure anything. Theyāre used just by merit of existing in your project. So, in the case of kriswallsmith/buzz, it expressly importsBuzz/Client/FileGetContents, not Buzz/Client/MultiCurl. I donāt know how, where, or why MultiCurl would be getting imported at all.
other wise
Iām not sure I follow. Do you mean you get that exception even with php-http/discovery set to false if kriswallsmith/buzz is not installed?
In your vendor subdirectory, is there guzzle or guzzlehttp directory in there?
I have not heard of WHMCS before, but itās beginning to sound like theyāre somehow injecting their own dependencies into the environment beyond your control, and theyāre conflicting. Itās the only thing I can think of that would cause this sort of thing.
Please keep me up to date on any alterations youāre making so we can troubleshoot this successfully. My only awareness of your applicationās state is in the context of what youāve shared with me here, so when you make changes we havenāt discussed, Iām flying blind.
Can you share what your Auth0 SDK initialization/configuration looks like right now? You mentioned manually importing MultiCurl ā we donāt want to be doing that here. Letās get a clean look at your configuration.
When upgrading from Auth0 PHP SDK v7 to v8, encountering an āInvalid State Errorā typically indicates issues with session handling or state parameter verification. Ensure session storage is properly configured and state parameter handling aligns with the new SDKās requirements to resolve this error.