SocialiteProviders / Providers

A Collection of Providers for Laravel Socialite
https://socialiteproviders.com
MIT License
507 stars 448 forks source link

The HTTP status code "0" is not valid on socialiteproviders #1097

Closed leonardocaitano closed 9 months ago

leonardocaitano commented 1 year ago

When I use the Socialite package with the Google or Facebook driver, it works normally. However, when I use the SocialiteProviders package with Apple (or other drivers), I always receive the error:

InvalidArgumentException: The HTTP status code "0" is not valid. in file /var/www/html/vendor/symfony/http-foundation/Response.php on line 497.

I am using Laravel 10:

"require": { "php": "^8.1", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.10", "laravel/sanctum": "^3.2", "laravel/socialite": "^5.8", "laravel/tinker": "^2.8", "socialiteproviders/apple": "^5.5", }

I reverted to an older version and it worked:

"require": { "php": "^8.0.2", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^9.11", "laravel/sanctum": "^2.14.1", "laravel/socialite": "^5.5", "laravel/tinker": "^2.7", "socialiteproviders/apple": "^5.3", }

But the issue is that I need to upgrade my project to Laravel 10.

in my controller:

    try {
        $user = Socialite::driver('apple')->stateless()->userFromToken($token);
    } catch (Exception  $e) {
        return response()->json(['message' => $e->getMessage()], $e->getCode());
    }

in services file:

'apple' => [
    'client_id' => env('APPLE_CLIENT_ID'),
    'client_secret' => env('APPLE_CLIENT_SECRET'),
    'redirect' => env('APPLE_REDIRECT_URI')
],
atymic commented 9 months ago

Closing due to inactivity. Please re-open if still an issue.