Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: SocialiteProviders\Zitadel\Provider doesn't exist after following installation guide #1294

Open
kriosmane opened this issue Nov 15, 2024 · 0 comments

Comments

@kriosmane
Copy link

kriosmane commented Nov 15, 2024

I'm encountering an issue when trying to integrate the SocialiteProviders/Zitadel package. Despite following the official installation guide step by step, Laravel throws the following error in app/Providers/AppServiceProvider.php:

SocialiteProviders\Zitadel\Provider doesn't exist

I've installed the package via Composer:
composer require socialiteproviders/zitadel

app/Providers/AppServiceProvider.php:

<?php

namespace App\Providers;

use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        Vite::prefetch(concurrency: 3);

        
        Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
            $event->extendSocialite('zitadel', \SocialiteProviders\Zitadel\Provider::class);
        });
        
    }
}

boostrap/providers.php:

<?php

return [
    App\Providers\AppServiceProvider::class,
    \SocialiteProviders\Manager\ServiceProvider::class
];

config/services.php:

<?php

return [

    ...
    'zitadel' => [
        'client_id' => env('ZITADEL_CLIENT_ID'),
        'client_secret' => env('ZITADEL_CLIENT_SECRET'),
        'redirect' => env('ZITADEL_REDIRECT_URI'),
        'base_url' => env('ZITADEL_BASE_URL'),
        'organization_id' => env('ZITADEL_ORGANIZATION_ID'),                      // Optional
        'project_id' => env('ZITADEL_PROJECT_ID'),                                // Optional
        'post_logout_redirect_uri' => env('ZITADEL_POST_LOGOUT_REDIRECT_URI')     // Optional
    ],

];

I try to redirect to the Zitadel Provider by :

return Socialite::driver('zitadel')->redirect();

Laravel version: 11.9
PHP Version: 8.2
Socialite version: v5.16.0
socialiteproviders/zitadel: 4.1.0
socialiteproviders/manager: v4.7.0

I cleared the cache using php artisan config:clear and php artisan cache:clear, but the issue persists.
I checked that the SocialiteProviders/Zitadel package is installed in the vendor directory.

Is there an additional step or configuration required that is missing from the documentation? Could this be related to the package version or a compatibility issue with Laravel 11?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants