Facebook Authentication
Follow these steps to set up Facebook Authentication.
Step 1: Create a Facebook App
- Go to the Facebook Developers Console.
- Click on “Get Started” and follow the prompts to create a developer account if you haven’t already.
- Once your account is set up, navigate to “My Apps” and click “Create App.”
- Choose “For Everything Else” and click “Next.”
- Enter your app’s name and email, then click “Create App ID.”
- On the app’s dashboard, go to “Add a Product” and select “Facebook Login.”
Step 2: Configure Facebook Login
- In the “Facebook Login” section, select “Web.”
- Under “Valid OAuth Redirect URIs,” add your redirect URL:
http://localhost:3000/api/auth/callback/facebook
for local development.https://example.com/api/auth/callback/facebook
for production.
Step 3: Copy Credentials to .env.local
- After creating your Facebook App, go to “Settings” > “Basic” and copy the
App ID
andApp Secret
. - In your project’s
.env.local
file, add the following environment variables and paste the values:FACEBOOK_CLIENT_ID
FACEBOOK_CLIENT_SECRET