LinkedIn OAuth Issues

Options

Hi,
I am having issues with the LinkedIn OAuth and was wondering if anyone else is experiencing the same issues, or knows how to fix it?

The following might be related to the issue I'm having, but it might not. Skip to the *** symbols if you just want to read the issue.

PSA: I think the Marketplace plugin might be outdated.


Here are a few things I had to change just to get it to partially work:

  • Important to note that Sign In with LinkedIn is deprecated and, instead, the product is now called Sign In with LinkedIn using OpenID Connect, which has different requirements and scopes.
  • In /oauth/linkedin/init theres a custom function linkedin_oauth_getauthurl. In the Create Variable section, there is a url_addarg value that is outdated. The scope parameters r_liteprofile and r_emailaddress needed to be changed to profile and email.
  • In /oauth/linkedin/continue there is a step in the function stack which accesses the table in your database that you use for Auth. In my case, that table is supposed to be User, but the plugin was pointing to a non existent table.

******************************* THE ISSUE BELOW *************************************

The above changes fixed most of the basic issues, but I am still getting an error
403 Not enough permissions to access: GET /me
and 403 Not enough permissions to access: GET-members /emailAddress

Has anyone encountered this or have ideas what I can do to fix this?

Thanks in advance

Best Answer

  • Adam Che
    Adam Che Member
    edited September 2023 Answer ✓
    Options

    Thanks again to @Michael Udinski for helping me solve the issue in office hours.

    In the end, the issues were due to LinkedIN changing their API, so the Xano plugin didn't have current information.

    Some things that needed changing:

    • In /oauth/linkedin/init theres a custom function linkedin_oauth_getauthurl. In the Create Variable section, there is a url_addarg value that is outdated. The scope parameters r_liteprofile and r_emailaddress needed to be changed to profile and email.
    • In /oauth/linkedin/continue there is a step in the function stack which accesses the table in your database that you use for Auth. In my case, that table is supposed to be User, but the plugin was pointing to a non existent table.
    • In /oauth/linkedin/init theres a custom function linkedin_oauth_getuserinfo.
      • The API call to /v2/emailAddress is no longer necessary so it can be taken out.
      • The /v2/me endpoint should be changed to /v2/userinfo.
      • The headers in that last endpoint should be changed to look like this:
    • And the Create Variable step in the function stack in the linkedin_oauth_getuserinfo custom function should be changed to look like the following:



    If I didn't forget anything, everything should work after those changes.

    For more info, here is the new LinkedIn documentation: https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2#api-request-to-retreive-member-details

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    At a guess the issue is the scopes you are requesting in your authorization code flow. Maybe sharing a bit more here would help. Also you might get insight if you are using a first party xano snippet from their office hours- next one is tomorrow.

    State Change, which I run, has daily office hours where we work on hard problems in no code. We just did instagram integration over a couple segments in hours last week.

    The devil is often in the details for these authentication challenges which is why I suggest these live interventions!