Last updated
Last updated
Go to .
Log in with your LinkedIn account or create one if you don't have it.
Click on Create App.
Fill in all basic details.
Associate your app with a company page (create one if you don’t have any).
Request app verification via the Settings > Verify button.
Paste the verification link into a new browser window.
Press Verify.
Access Client ID and Secret from the Auth tab in the developer dashboard.
Go to the Products tab and request access to Sign In with LinkedIn using OpenID Connect and Share on LinkedIn.
🚨 Important: LinkedIn servers will only communicate with trusted URLs. Ensure your callback URL meets the following criteria:
Must be absolute:
https://example.com/auth/linkedin/callback
Parameters are ignored:
https://example.com/auth/linkedin/callback?id=1
becomeshttps://example.com/auth/linkedin/callback
Cannot include a
#
:https://example.com/auth/linkedin/callback#linkedin
is invalid.
🔒 Tip: Use a
.env
file for secure storage of credentials.
Ensure your redirect_uri
matches the callback URL in both LinkedIn app settings and Django URLs.
Generates the login URL for LinkedIn authentication.
Example:
Exchanges the authorization code for an access token.
Example:
Fetches the authenticated user’s profile data.
Example:
🔒 Secure Credentials: Use environment variables to protect sensitive data.
🔗 Match Redirect URI: Ensure consistency between LinkedIn app settings and your application code.
⚠️ Handle Errors Gracefully: Implement error handling for a smooth user experience.