pirmax's avatar

Lumen 5.5 Socialite Providers doesn't works with setConfig()

I use Laravel Socialite Providers (https://socialiteproviders.github.io/) to login user on Lumen 5.5 API. setConfig() method, to force config, doesn't works for me...

Here below, my error and my code. The problem is that I do not know why I have this error.

Display Error:

Type error: Argument 1 passed to Laravel\Socialite\SocialiteManager::formatConfig() must be of the type array, null given, called in /home/vagrant/www/project1/api.website.app/vendor/laravel/socialite/src/SocialiteManager.php on line 125

PHP code:

$clientId = env('TWITTER_KEY');
$clientSecret = env('TWITTER_SECRET');
$redirectUrl = env('TWITTER_REDIRECT_URI');
$additionalProviderConfig = [];
$config = new SocialiteConfig($clientId, $clientSecret, $redirectUrl, $additionalProviderConfig);

return Socialite::with('twitter')->stateless()->setConfig($config)->redirect();
0 likes
2 replies
spopic's avatar

You have to set your Client ID, Secret and RedirectURL in your config/services.php file.

That solved my problem

Vipink96744's avatar

I am also getting the same error. I have already set the client ID, secret and redirect url but nothing works in the code

Please or to participate in this conversation.