Skip to content

Commit

Permalink
feat: add readme for access token generating
Browse files Browse the repository at this point in the history
  • Loading branch information
rozekmichal committed Jan 16, 2025
1 parent 480e4f6 commit 8d5b3a3
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions docs/docs/Linkedin Client/generating-access-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# How to Generate an Access Token Manually Using the LinkedIn Developer Portal

The LinkedIn access token is essential for enabling API calls on behalf of a user. It allows your application to interact with LinkedIn's API to perform actions such as posting updates, accessing user profiles, and managing LinkedIn pages. The following instructions will guide you through the process of generating this token.

## Step 1: Create a New Application

1. Navigate to the [LinkedIn Developer Portal](https://developer.linkedin.com/).
2. Click the **Create app** button.
3. Fill in the **App name** field.
4. Specify a **LinkedIn Page** (either select an existing page or create a new one).
5. Upload a **logo** from your local device.
6. Agree to the terms and conditions by selecting **I have read and agree to these terms**.
7. Complete the process by clicking the **Create app** button.

## Step 2: Configure Your Linkedin Application

1. Navigate to the **Products** tab in your application.
2. Under **OAuth Permissions**, select the following scopes:
- **Sign In with LinkedIn using OpenID Connect**
- **Share on LinkedIn**

## Step 3: Generate an Access Token

1. Open the **Auth** tab in your application.
2. Click on the **OAuth 2.0 tools** link (you can also navigate via **Docs and tools > OAuth Token Tools** in the navigation bar).
3. Press **Create token** to start the process.
4. Ensure the **OAuth flow** is set to **Member authorization code (3-legged)**.
5. Under **Select scopes**, check the boxes for:
- `openid`
- `profile`
- `w_member_social`
6. Click the **Request access token** button.
7. Log in using your LinkedIn credentials and click **Sign In**.
8. Grant your application the requested permissions by selecting **Allow**.
9. After successful authorization, your **access token** will be displayed and is ready for use.

### Resolving Common Issues

If you encounter the error:

> "We can’t verify the authenticity of your request because the state parameter was modified."
This may indicate that your browser is blocking the request. To resolve:

- Disable all browser extensions temporarily.
- Try generating the token in another browser (e.g., Google Chrome).

```
Important! Be aware that some browsers, such as Brave, have built-in protections that might block token generation.
```

## Important Notes

- The access token is valid for **2 months**. After expiration, you must repeat the steps above to generate a new token.
- If the token does not have all the required permissions, regenerate it and ensure the correct scopes are selected.
- Generating the access token automatically updates the **Authorized redirect URLs for your app** field in your application.

### What Is a Redirect URL?

A **redirect URL** is the URI where users are sent after authorization. It must match one of the redirect URLs defined in your application configuration.

For more detailed information, visit Microsoft's official documentation on the [Authorization Code Flow (3-legged OAuth)](https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?tabs=HTTPS1).

0 comments on commit 8d5b3a3

Please sign in to comment.