We've updated our Terms of Service. By continuing to use our services, you agree to the updated Terms.

LinkedIn Social Login with Magic

LinkedIn Social Login with Magic

#Overview

You can allow your users to sign up & log in to your web app with their LinkedIn account.

#Usage

#Prerequisites

note

Magic SDK offers two OAuth extensions: v1 and v2. For web applications, it is recommended to use v2, while v1 should be used for mobile applications.

#LinkedIn Setup (v1 extension)

After installing the OAuth extension, you can now enable LinkedIn Login for your Magic app:

  1. Follow LinkedIn's instructions to create an app
  2. Go to your Magic Dashboard
  3. Select the Magic app for which you’d like to enable LinkedIn Login, or create a new app
  4. Navigate to Social Login from the sidebar
  5. Click the toggle for LinkedIn
  6. Copy the Redirect URI field from your Magic Dashboard
  7. Return to your LinkedIn App Dashboard and select "Sign in with LinkedIn" in the "Products" tab
  8. Select Auth tab, add the Redirect URI you obtained from your Magic Dashboard into the "Authorized redirect URLs for your app" field
  9. Click "Update" to save
  10. Obtain the "Client ID" and "Client Secret"
  11. Return to your Magic Dashboard and input the Client ID and Client Secret for your LinkedIn OAuth app
  12. In Magic Dashboard, click “Save” – Done!

#LinkedIn Setup (v2 extension)

  • Follow above steps, but disregard Magic's Redirect URI in step 6
  • In step 8, paste the Redirect URI you are passing in as the redirectURI argument to the loginWithRedirect method
Javascript
01await magic.oauth2.loginWithRedirect({
02  provider: 'linkedin',
03  redirectURI: 'https://your-app.com/your/oauth/callback', // <== whitelist this with LinkedIn
04});

#Resources