In this tutorial, we'll set up LinkedIn authentication for Conduit.
Step 1: Set up LinkedIn authentication
To set up LinkedIn authentication, we'll need to add the LinkedIn provider to our project.
Creating a LinkedIn Web App
To create a LinkedIn Web App, follow these steps:
- Go to the LinkedIn Developer Portal and log in with your LinkedIn account.
- Click Create App.
- Enter a name for your app and click Create App.
- Click Edit next to OAuth 2.0 settings.
- Add
your_redirect_url
to the Authorized redirect URLs field. - Click Save.
Adding the LinkedIn Provider
NOTE
Do not forget to configure the LinkedIn provider through the Admin Panel.
Go to the Authentication -> SIGN IN METHODS and select the LinkedIn provider.
Then, fill the required fields you obtained from the LinkedIn App.
Authenticate with LinkedIn
To begin authenticating with LinkedIn you request a redirect url with the proper scopes
Request
curl --location --request GET 'http://localhost:3000/authentication/linkedin'
Response
{
"result": "https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=123456789&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauthentication%2Flinkedin%2Fcallback&state=eyJpZCI6IjYzN
}
Open a browser and navigate to the url returned to you from Conduit.
Now the /hook/authentication
route has been triggered.
Once your browser has been redirected, your authentication has been completed.