This guide explains how to set up Facebook as an authentication provider with Stack Auth. Facebook OAuth allows users to sign in to your application using their Facebook account.
Integration Steps
Create a Facebook OAuth App
- Navigate to the Facebook Developers Portal.
- In the top-right, select My Apps and then Create App.
- You'll be redirected to the Create an app process.
- In the App details step, select the app type (typically Consumer for authentication), fill out the necessary information, and select Next.
- In the Use Cases step, select Authenticate and request data from users with Facebook Login and then select Next.
- In the Business step, select the business portfolio to connect to your app and then select Next.
- In the Finalize step, select Go to dashboard. You'll be redirected to the app's Dashboard page.
- In the left sidenav, select Use cases.
- Next to Authenticate and request data from users with Facebook Login, select Customize.
- On the Permissions tab, next to email, select Add to allow Stack Auth to read your user's primary email address.
- In the left sidenav, under Facebook Login, select Settings.
- In the Client OAuth settings section, in the Valid OAuth Redirect URIs field, add
https://api.stack-auth.com/api/v1/auth/oauth/callback/facebook
- Select Save changes.
- In the left sidenav, select App settings (hover over the settings icon), and then select Basic.
- Note your App ID and App Secret for the next steps.
Enable Facebook OAuth in Stack Auth
- On the Stack Auth dashboard, select Auth Methods in the left sidebar.
- Click Add SSO Providers and select Facebook as the provider.
- Set the App ID and App Secret you obtained from the Facebook Developers Portal earlier.
Need More Help?
- Check the Facebook Login Documentation
- Join our Discord