Login via Facebook
How to configure OAuth2 login via Facebook
To let your users sign in with their Facebook account, follow the below steps.
- Register a Meta Developer account.
- Navigate to the Facebook apps page.
- Click Create app.
- Choose Authenticate and request data from users with Facebook Login, then Next:
- Click No, I’m not building a game, then Next.
- Give the application a name and provide a contact email, then click Create app:
- Enable the
email
permission: - In Facebook Login settings (the page shown above), make sure Web OAuth login is enabled, and add the Facebook callback URL
https://<your-comentario-domain>/api/oauth/facebook/callback
as Valid OAuth Redirect URI: - Navigate to App settings ⇒ Basic. There you’ll be able to copy App ID and App secret. Store them in a safe place for future reference. Also provide additional details (Privacy policy URL, Data deletion URL):
- Submit the application for verification.
- Update the secrets configuration with the above data, putting the App ID into
key
and App secret intosecret
:
...
idp:
facebook:
key: 413690874551549
secret: 84c8b978cdd0bb3b12d5069fdfac3185
...
- Restart Comentario. You should now see Facebook under Configured federated identity providers on the Static configuration page of the Administration UI.
- Still in the Admin UI, navigate to the desired domain properties and tick off Facebook on the Authentication tab, then click Save.
That’s it! Your users should now be able to login using the Facebook button in the Login dialog.