Connect Apps to Facebook
Add Facebook Sign in to your apps in less than 5 minutes.
Last updated
Add Facebook Sign in to your apps in less than 5 minutes.
Last updated
This guide shows how to connect your Authgear application to Facebook so users can log in using the Login with Facebook feature.
If you are using Authgear in your existing Facebook Apps, you may skip to the next step to set up the OAuth client.
You will need a Facebook developer Account. Register as one by clicking Get Started in the Facebook for Developers website.
To create a new app, go to the Facebook Developers Apps panel then click the Click Create App button.
On the next screen, select Other as your app use case then, click Next.
In the app type selection screen, pick the option that best meets your requirements. For our example, we'll select the Consumer app type.
Enter your app name on the next screen and finish the app creation process.
In the app panel, click Add Product next to Products in the sidebar.
Click the Set Up button in Facebook Login.
Go to Settings of Facebook Login.
Make sure Client OAuth Login and Web OAuth Login are enabled.
Add https://<YOUR_AUTHGEAR_ENDPOINT>/sso/oauth2/callback/facebook
to Valid OAuth Redirect URIs and save the changes.
Redirect URI has the form of https://<YOUR_AUTHGEAR_ENDPOINT>/sso/oauth2/callback/:alias
. The alias
is used as the identifier of OAuth provider. You can configure the alias
in Authgear Portal.
See Your Authgear Endpoint for instructions on how to get the value for YOUR_AUTHGEAR_ENDPOINT
.
After setting up the Facebook Login product, go to App settings > Basic in the sidebar.
You will need the App ID and App Secret to configure Facebook Login so, note them down.
In the portal, go to Authentication > Social / Enterprise Login.
Enable Login with Facebook.
Fill in the Client ID with the App ID obtained from the Facebook Developers portal in the previous step.
Save the settings.
🎉 Done! You have just added Facebook Login to your apps!
Your end-users can now sign in with Facebook on Authgear's pre-built Log In and Sign Up page. Existing end-users can connect their account to Facebook in the User Settings page.