Sep 20, 2016
0
Level 7
Socialite makes wrong redirect
I installed Laravel Socialite on Lumen 5.2, but can't make it work.
.ENV:
FB_KEY=xxx
FB_SECRET=xxx
FB_CALLBACK=http://lumen.app/auth/facebook/callback
config/services.php
<?php
return [
'facebook' => [
'client_id' => env('FB_KEY'),
'client_secret' => env('FB_SECRET'),
'redirect' => env('FB_CALLBACK'),
],
];
routes.php
$app->get('/auth/facebook', ['uses' => 'App\Http\Controllers\AuthController@redirectToProvider']);
$app->get('/auth/facebook/callback', ['uses' => 'App\Http\Controllers\AuthController@handleProviderCallback']);
AuthController.php
public function redirectToProvider()
{
Socialite::driver('facebook')->stateless()->redirect();
}
But when I open http://lumen.app/auth/facebook, it redirects me to FB page with an error The parameter app_id is required.
echo Socialite::driver('facebook')->stateless()->redirect()->getTargetUrl(); // https://www.facebook.com/v2.6/dialog/oauth?scope=email&response_type=code
This URL doesn't have client credentials, and I don't know why.
Does anybody have any ideas?
Please or to participate in this conversation.