I have implemented two social features in my Laravel application using Socialite: share and login.
I have the settings in .env and, correspondingly, in config/services.php:
'facebook' => [
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
'redirect' => env('FACEBOOK_REDIRECT_URI')
],
I have a Facebook share option for articles on the site and it works fine, taking the user to:
https://www.facebook.com/sharer/sharer.php?u=example.com/rest-of-url
The share dialog is there and the user can post to his wall correctly.
However, login with Facebook gives the following error:
Login Failed: You can't use Facebook to log into this app or website because there's an issue with its implementation of Facebook Login.
The URL that the user is directed to looks correct:
Does someone have any idea what could be wrong, or at least how to get a more meaningful error message to troubleshoot with?
EDIT: upon debugging after the callback, I see that I get a "400 unauthorized" error. But the client ID and client secret are correct, so what might be the problem?