0

So I am having the same problem as this user here : Laravel Socialite Facebook Login Error: The parameter app_id is required

and I have followed the solution give to this user. but I still get the same error. even tried changing clinet_id to app_id.. nothing has changed the same error

The parameter app_id is required

 'facebook' => [
        'client_id' => 'hidden', //Facebook App Client ID
        'client_secret' => 'hidden', // Your Facebook App Client Secret
        'redirect' => 'http://localhost:8000/login/facebook/callback', // Your application route used to redirect users back to your app after authentication
    ],

route:

Route::get('login/facebook', 'Auth\LoginController@redirectToProvider');
Route::get('login/facebook/callback', 'Auth\LoginController@handleProviderCallback');

I cant see whats wrong here. added everything. from the documentation. in service the facade. what can be my mistake here? I feel its fairly obvious but I cant see it

Demeteor
  • 1,193
  • 2
  • 17
  • 33

1 Answers1

0

you have to set app id, secret and call back url in config file so open config/services.php and .env file then set id and secret this way:

 'facebook' => [
        'client_id' => env('FACEBOOK_CLIENT_ID'),
        'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
        'redirect' => env('FACEBOOK_CALLBACK_URL'),
    ],

.env

FACEBOOK_CLIENT_ID=xxxxxxxxx
FACEBOOK_CLIENT_SECRET=xxxxxxx
FACEBOOK_CALLBACK_URL=http://localhost:8000/login/facebook/callback

After completion of .env edit please enter this command in your terminal for clear cache:php artisan config:cache

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
  • Hello, I have tried it with the env variables but still the same issue, Shall I try remaking the facebook app to get a new id? maybe I have a problem from there? – Demeteor Jan 21 '19 at 10:23
  • @Demeteor You should try for a testing purpose, also whenever the change in `.env` file please **clear cache** – Udhav Sarvaiya Jan 21 '19 at 10:26
  • Hello created an entirely new app. got the new keys, but same result. – Demeteor Jan 21 '19 at 10:32
  • @Demeteor **The parameter app_id is required** This is the solution for this error but maybe you have something else problem, try to use in the latest version in socialite, use Composer to add the package to your project's dependencies:`composer require laravel/socialite` – Udhav Sarvaiya Jan 21 '19 at 10:51
  • that is how I installed socialite in the 1st place. maybe my error is one of those 2? this is in service provider Laravel\Socialite\SocialiteServiceProvider::class, and this is my Alias 'Socialite' => Laravel\Socialite\Facades\Socialite::class, maybe I did not add something else needed? – Demeteor Jan 21 '19 at 10:58
  • you have properly configuration in `config/app.php` file where **provider** and **facade** register properly – Udhav Sarvaiya Jan 21 '19 at 11:04
  • ok so if my app.php configuration is done properly , what else could be the problem? – Demeteor Jan 21 '19 at 11:14
  • @Demeteor I don't know whether your any other part of code any error, this is my successful [socialite repository](https://github.com/udhavsarvaiya/Socialite), hope you have to get some idea – Udhav Sarvaiya Jan 21 '19 at 11:18
  • ok friend. ill look it up later today. ill post my solution once i get it. thanks for your help – Demeteor Jan 21 '19 at 11:35