0

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:

https://www.facebook.com/v3.0/dialog/oauth?client_id=myclientid&redirect_uri=https://example.com%2Fsocialite%2Flogin%2Ffacebook%2Fcallback&scope=email&response_type=code&state=Vn8L1gcutzi3xbbHCxBr7lXltuLkMsnFkoG4dEtu

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?

sveti petar
  • 3,637
  • 13
  • 67
  • 144
  • Maybe you should check the following Q&A https://stackoverflow.com/questions/30590243/using-laravel-socialite-to-login-to-facebook – Hackerman Jan 15 '19 at 12:30
  • Thanks. Seeing how I have all the required routes and settings, I suppose the natural conclusion is that it might be an issue on the "Facebook side" as one answer put it. Since my client owns the app, I will have to request access from him. Do you know if app ownership could have something to do with the issue? – sveti petar Jan 15 '19 at 12:47
  • @Hackerman also please see my edit above – sveti petar Jan 15 '19 at 12:57
  • Make sure you're logging in with a Facebook user that has some sort of role in the app - you should get debug details beyond "there's an issue with its implementation" if you're an admin, developer, or tester role in the application. – ceejayoz Jan 15 '19 at 15:20

0 Answers0