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
- You will need a LinkedIn account
- You will need to have the Magic SDK installed into your web app
- You will need to have the Magic SDK - OAuth Extension installed into your web app
#LinkedIn Setup (v1 extension)
After installing the OAuth extension, you can now enable LinkedIn Login for your Magic app:
- Follow LinkedIn's instructions to create an app
- Go to your Magic Dashboard
- Select the Magic app for which you’d like to enable LinkedIn Login, or create a new app
- Navigate to Social Login from the sidebar
- Click the toggle for LinkedIn
- Copy the Redirect URI field from your Magic Dashboard
- Return to your LinkedIn App Dashboard and select "Sign in with LinkedIn" in the "Products" tab
- Select Auth tab, add the Redirect URI you obtained from your Magic Dashboard into the "Authorized redirect URLs for your app" field
- Click "Update" to save
- Obtain the "Client ID" and "Client Secret"
- Return to your Magic Dashboard and input the Client ID and Client Secret for your LinkedIn OAuth app
- 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});