SocialiteProviders / Providers

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

Azure B2C provider failing with not supported? #1156

Closed baradhili closed 9 months ago

baradhili commented 9 months ago

I'm running into this problem

$targeturl = Socialite::driver('azureadb2c')->redirect();

InvalidArgumentException  Driver [azureadb2c] not supported.

install/setup is double checked against readme, calling calls has use Laravel\Socialite\Facades\Socialite;

Kind of at my wits end - has anyone else hit this? I know there is work in flight to merge azure and azureb2c

atymic commented 9 months ago

Can you show your EventServiceProvider?

baradhili commented 9 months ago
<?php

namespace App\Providers;

use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event to listener mappings for the application.
     *
     * @var array<class-string, array<int, class-string>>
     */
    protected $listen = [
        \SocialiteProviders\Manager\SocialiteWasCalled::class => [
            // ... other providers
            \SocialiteProviders\AzureADB2C\AzureADB2CExtendSocialite::class.'@handle',
            \SocialiteProviders\GitHub\GitHubExtendSocialite::class.'@handle',
        ],
        Registered::class => [
            SendEmailVerificationNotification::class,

        ],

    ];

    /**
     * Register any events for your application.
     */
    public function boot(): void
    {
        //
    }

    /**
     * Determine if events and listeners should be automatically discovered.
     */
    public function shouldDiscoverEvents(): bool
    {
        return false;
    }
}
baradhili commented 9 months ago

Is there a way to list the current installed providers? @atymic

baradhili commented 9 months ago

ok I found something that fixes it :) in /config/app.php I needed to replace "Laravel\Socialite\SocialiteServiceProvider::class," with "\SocialiteProviders\Manager\ServiceProvider::class,"

atymic commented 9 months ago

Do you have provider auto discovery off?

baradhili commented 8 months ago

Not sure, I don't see where I can set provider auto discover on?