Linkedin credential errors

Hello,

I have an error with the linkedin credential:
Received following query parameters: {“error”:“unauthorized_scope_error”,“error_description”:“Scope "r_liteprofile" is not authorized for your application”,“state”:“eyJ0b2tlbiI6IlYxQ0tlS3g5LUtacnRLWDlqT3pzZVJ6Qi1FemxsbTVsb0IzRSIsImNpZCI6IndWZ290a2FjZjFvbWduV0gifQ==”}

I don’t understand because I add the requested products:

Do you know I do wrong?


Thank you

HI @oswald_bernard :wave: Sorry you’re running into this!

Can you try to enable “Sign In with LinkedIn” under the products tab? That should stop that error :+1:

1 Like

Just to add to this… You may also need to use the new marketing product type and go through the business verification process that LinkedIn has started to enforce.

Hello,

I have no sign in with LinkedIn. The only option I have that looks like this option is the sign in with open I’d like I showed in the picture.

Thank you so much for your reply :wink:

Hello,

I will try this. I let you know.

Thank you so much

Hello, I have the same problem on my LinkedIn, there is only the option “Sign In with LinkedIn using OpenID Connect”, and from what I researched on GitHub people were saying that LinkedIn discontinued "
Sign In with LinkedIn" and all new applications created there will be with OpenID, would it be possible to update n8n to support OpenID?

Hey @rubensflinco,

LinkedIn still support OAuth2 and have not removed support for it, The issue is that LinkedIn recently changed the scopes. We have a dev ticket open to update the scopes but we need to find a way to change them without breaking the credential for users that have the older LinkedIn API products in place.

@Jon I understand, I think a good way would be to create a new field on the credential confirmation page where it asks the user if they want to use the new one with OpendID or the old one, and in the migration the current ones are defined with the old version, and the new ones user chooses to choose the new one from the field, what do you think about this suggestion, could you send me the PR or Issue you mentioned I would love to take a look at the Dev maybe I can contribute something.

Hey @rubensflinco,

The authentication process itself is still exactly the same so it shouldn’t need a new credential the only change is in the oauth scopes that are sent. There is currently no PR for this just an internal linear ticket which has a reference of NODE-780.

The specific line of code is here: https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/credentials/LinkedInOAuth2Api.credentials.ts#L45C9-L45C9

In theory we could just change

'=w_member_social{{$self["organizationSupport"] === true ? ",w_organization_social":",r_liteprofile,r_emailaddress"}}',

to

'=w_member_social{{$self["organizationSupport"] === true ? ",w_organization_social":",profile,email"}}',

But if we do that it will break for anyone using older LinkedIn apps, What we could really do with is a way to version credentials internally like we do with nodes so anyone adding a new credential would just get the new version but that would take more dev work and planning.

It could be that we end up using a dropdown box to toggle between the options or maybe LinkedIn supports optional scopes in which case we can just send all 4 and hopefully it would use whatever it wants.

2 Likes

@Jon
I saw that the “scope” is like a hidden input with a default value, right?

Why don’t we just let it be a string field and appear on the screen with a pre-defined value? and the person changes the way they want?

I did some tests here, and for it to work you really need to change the value. There is no way to leave the values from the old version and add the new ones, either the new ones or the old ones.

@Jon
I went a little deeper and even though I changed the scope by making the connection on LinkedIn, the credential part works well but the rest of the Node and the other functionalities don’t seem to work anymore, for example to load the “Person Name” the n8n cannot have permission maybe because the API has changed too or is it just permission?

I saw that it is also not possible to send the publication even in the “Organization” option and entering the ID of my LinkedIn page.

Then I wonder, wouldn’t it be ideal if we launched a new Node since it’s not just a credential issue?

Hey @rubensflinco,

During my testing I found that changing the scopes resolved the issue. Changing the field to a string field may not work as we don’t store the scopes in the database so when it comes to refresh it would in theory use the default values for the credential which will cause more issues.

Where it gets more tricky is you can’t have one application in LinkedIn that can do both posting as a user and as an organization so if you have org support with the community API you won’t be able to post as yourself or list the Person but if you use a default app type you can.

This is one of those issues where there is a potential quick fix but it needs to be thought about to see how it would impact other things.

@oswald_bernard Hi Oswald, I’m having this exact same issue if you have found the solution kindly share it with me as well. I have added the Sign In with Linkedin using OpenID Connect in the added products and I have given all the permissions which are profile, openid, email, and w_social_member. But still, I’m getting the error Bummer something went wrong.


1 Like

Hey @Saad_Ali,

Welcome to the community :raised_hands:

Take a look at my post above it explains what the issue is, At the moment the only workaround would be to manually create an OAuth credential and use the http request node to call the API

1 Like

Hi @Jon,
Thank you so much for replying so quickly
I’m a junior developer I read your comments but I didn’t understand your explanation right now I’m not calling the API. I’m signing my users into my website via LinkedIn but I’m getting the Bummer something went wrong error so I’m not able to authenticate my users with their LinkedIn account, therefore, I’m not getting the access token of my user and since I do not have any access token, therefore, I’m not being able to make any API request on behalf of my users.
Kindly guide me @Jon .

Hey @Saad_Ali,

How are you trying to sign them into your website with n8n? Is it safe to assume that you are not using n8n at all?

any news on this topic? having the same issue. but I am too much a noob to use http requests…
but I found it interesting that I see when using http that I only have 1 scope, whereas is should have at least 4.

1 Like

Hey @pehaem,

I have a couple of ideas I want to toy with this week to at least get things mostly working.

2 Likes

that would be amazing.

following, having some issue