Usage

Prerequisites

Facebook Setup (v1 extension)

After installing the OAuth extension, you can now enable Facebook Login for your Magic application:
  1. Follow Facebook’s instructions to register a Facebook application
  2. When creating your Facebook application, select Authenticate and request data from users with Facebook Login, click Next and follow the prompts to add app information
facebook-step-1.png
  1. On the next screen, you’ll be presented with steps to customize your Facebook application. Click Customize adding a Facebook Login button.
facebook-step-2.png
  1. Go to your Magic Dashboard
  2. Select the Magic app for which you’d like to enable Facebook Login, or create a new application
  3. Navigate to Authentication -> Social Logins from the sidebar
  4. Click the toggle for Facebook
  5. Copy the Redirect URI field from your Magic Dashboard
  6. Back in your Facebook Login Settings, paste the Redirect URI in the Valid OAuth Redirect URIs input and save the changes
facebook-step-4.png
  1. From the main Facebook dashboard, click on App Settings -> Basic
  2. Copy the App Id and App Secret
facebook-step-5.png
  1. From the Magic Dashboard, add your App Id and App Secret to your Facebook Login configuration
  2. Click Save
  3. Click Test Connection to give your new Facebook OAuth flow a try!

Facebook Setup (v2 extension)

  • Follow above steps, but disregard Magic’s Redirect URI in step 8
  • In step 9, paste the Redirect URI you are passing in 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
});

Resources