Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Community Management API: Fix for r_basicprofile Scope and Handling OpenID/Profile Scopes in passport-linkedin-oauth2 #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vilasshetkar
Copy link

@vilasshetkar vilasshetkar commented Dec 5, 2023

Description

This pull request addresses an issue related to the r_basicprofile scope in the passport-linkedin-oauth2 repository. The problem arises when the "Community Management API" product is enabled, leading to the unavailability of the openid or profile scopes. Consequently, the https://api.linkedin.com/v2/userinfo API throws an error under these conditions.

Changes Made

  • Added a fix to address the issue caused by the unavailability of openid or profile scopes when the "Community Management API" product is enabled.
  • Implemented a check for the presence of the r_basicprofile scope. If this scope is added, the profile is now fetched from the https://api.linkedin.com/v2/me endpoint.

Context

The LinkedIn API behavior change, particularly when certain products like "Community Management API" are enabled, has been causing errors due to missing scopes. This pull request ensures a robust handling mechanism, ensuring a smooth experience even under such circumstances.

How to Test

  1. Enable the "Community Management API" product in your LinkedIn Developer account.
  2. Attempt authentication with the affected scopes (openid or profile) using the passport-linkedin-oauth2 strategy.
  3. Verify that the error no longer occurs and that the profile is correctly fetched when the r_basicprofile scope is present.

Related Issues
Closes: #102

Additional Notes

Please review and merge this pull request at your earliest convenience. If there are any concerns or questions, feel free to reach out. This fix ensures compatibility with the latest LinkedIn API changes, providing a seamless experience for users utilizing the "Community Management API" product.

Thank you for your time and consideration.

Best regards,
Vilas Shetkar

@vilasshetkar vilasshetkar changed the title Fix for r_basicprofile Scope and Handling OpenID/Profile Scopes in passport-linkedin-oauth2 Community Management API: Fix for r_basicprofile Scope and Handling OpenID/Profile Scopes in passport-linkedin-oauth2 Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InternalOAuthError: failed to fetch user profile (new Community Management API of LinkedIn)
1 participant