https://github.com/maxime-hrt/linkedin-oauth
https://github.com/maxime-hrt/linkedin-oauth
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxime-hrt/linkedin-oauth
- Owner: Maxime-Hrt
- Created: 2024-03-05T22:44:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-07T00:58:41.000Z (about 1 year ago)
- Last Synced: 2025-02-02T03:45:46.946Z (4 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LinkedIn OAuth 2.0
## Configuration
1. Go to the [LinkedIn Developer Console](https://www.linkedin.com/developers/apps) and create a new app.
2. Copy the `Client ID` and `Client Secret` from the app settings.
3. Apply the scopes you need
4. Add the `Redirect URL` to the app settings.## Installation
Install the dependencies:
```bash
npm install
```## Usage
Create a `.env` file in the root of the project and add the following:
```env
CLIENT_ID=
CLIENT_SECRET=
REDIRECT_URI=
```Replace `` and `` with the `Client ID` and `Client Secret` from the LinkedIn app settings.
Start the server:
```bash
node server.js
```Open your browser and navigate to `http://localhost:3000`. Click the `Login with LinkedIn` button and authorize the app. You will be redirected to the `Redirect URL` with the `code` in the query string. The server will exchange the `code` for an `access_token` and log them to the console.