Skip to main content

Usage

Prerequisites

Facebook Setup

After installing the OAuth extension, you can now enable Facebook Login for your Magic app:
  1. Follow Facebook’s instructions to register a Facebook app
  2. When creating your Facebook app, select Authenticate and request data from users with Facebook Login, click Next and follow the prompts to add app information
Facebook app creation screen with authentication option selected
  1. Complete your Facebook app setup
  2. In your Facebook app’s Advanced Settings page, add your Redirect URI in the Share Redirect Allow List input:
Facebook Advanced Settings showing Share Redirect Allow List input field
Add the Redirect URI you are passing as the redirectURI argument to the loginWithRedirect method:
JavaScript
await magic.oauth2.loginWithRedirect({
  provider: 'facebook',
  redirectURI: 'https://your-app.com/your/oauth/callback', // whitelist this with Facebook
});
  1. Save the changes in your Facebook settings
  2. From the main Facebook dashboard, click on App Settings -> Basic
  3. Copy the App Id and App Secret
Facebook App Settings showing App ID and App Secret credentials
  1. Go to your Magic Dashboard
  2. Select the Magic app for which you’d like to enable Facebook Login, or create a new app
  3. Navigate to Social Login from the sidebar
  4. Click the toggle for Facebook
  5. Input the App Id and App Secret from your Facebook app
  6. In Magic Dashboard, click Save

Resources