LinkedIn Oauth profile data

I am using v2 and it is not each time this is why I try to understand how oauth create/update user. Atm I cant see a linkedin user id field stored or so.
I will try to reproduce it and let you know

I am getting the following response.Please provide solution.

There was an issue setting up your call.

Raw response for the API
{“serviceErrorCode”:65600,“message”:“Invalid access token”,“status”:401}

7 Likes

Hi,

I’m trying to log in in run mode as requested here:

But when I do so, upon coming back to the Bubble app from authorizing the app on LinkedIn, I get the following error:

However, the client ID (App ID) is filled, so I’m a bit stuck :confused:

Did someone encounter this issue?

Just to be more precise with where I’m stuck, here is the whole flow as well as my LinkedIn and Bubble settings.

Guessing here … but I wonder if the API Connector is sending the data as JSON rather than x-www-form-urlencoded as LInkedin wants it.

Hi Nigel, thanks for jumping in. Is there a way I can test this? However, it would be strange that no one in this thread reported the issue before…

I know, it was just some guessing in my part.

You could probably try to do the oauth from a static link on a button to the authorization API.

Then take the code and do the token exchange yourself.

That would show if your details are set up correctly.

If you can wait 24 hours I can try to set it up myself to test, as I am knee-deep in the V2 Linkedin API at the moment.

Trying to do what you suggested with the following static URL:

Authorize | LinkedIn

Response URL I get is like this:

https://domain.bubbleapps.io/api/1.1/oauth_redirect?code=some_very_long_string&state=the_random_string_I_had_defined

I’m not sure how to do the token exchange myself now… :sweat_smile:

Happy to send you a link to my editor in PM if you have the time to take a look. Otherwise I can wait, no problem, that’s awesome if you are working on this just now too!

1 Like

So take “some very long string” which is the code and do the token exchange.

From here …

https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context

POST /oauth/v2/accessToken HTTP/1.1
Host: www.linkedin.com
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code&code={some very long string}&redirect_uri=hhttps%3A%2F%2Fdev.example.com%2Fauth%2Flinkedin%2Fcallback&client_id={your_client_id}&client_secret={your_client_secret}

So something like …

https://www.linkedin.com/oauth/v2/accessToken?grant_type=authorization_code&code={some very long string}&redirect_uri=hhttps%3A%2F%2Fdev.example.com%2Fauth%2Flinkedin%2Fcallback&client_id={your_client_id}&client_secret={your_client_secret}

You may need to do this in the API connector rather than a browser.

1 Like

I did it in the API connector and it worked:

Not sure where to go from there :thinking:

1 Like

Well, it proves that your creds are fine ! I have just tried to get it working myself, and I also got the same error regardless.

What did the API connector set up look like ?

So you could take that access_token, store it, and use it as Authorization : Bearer and call the API.

Or you could raise a bug with Bubble ? Not sure it is really a bug thought, more like a feature request for the ability to set Content-Type on API connector. Linkedin are explicit about this…

The next step is to get an access token for your application using the authorization code from the previous step. To do this, make the following HTTP POST request with a Content-Type header of x-www-form-urlencoded :

And I think that is the issue.

@neerja - What do you think ?

The previous posts were all prior to V2 of the Linkedin API. Microsoft have made a load of changes and renamed things all over the place. So not surprised it has changed so much.

For that call the API Connector setup was just “Authentication: none or self-handed” and I passed everything in the URL.

I think it was actually a bug: Neerja had a look and built a new API Connector with the very same setup I showed in my screenshots before and it worked… :man_shrugging: Although, she was the one originally validating the API Connector, I can also validate it now myself:

UPDATE:: just after ranting I tried to update credentials with a temp password and it WORKS

I’m pulling my hair and couldnt find any reasonable workflow so a user could add his email. That’s really painful and we should be able to update the email address or at leats send a pw reset link…

Hi,

I have succesfully implemented the linkedin login api as @neerja recommended and I got many users who signud up with it. However, the API often stops working for a few hours during the day and starts to work again…

I aslo get this message associated with the API : “Your token is not valid any more. You should sign up again in run mode to get a token to set up and modify your calls”.

Does anyone knows how to solve this issue ?

I’ve also tried to use the Linkedin Plugin instead (even if I will loose the email of the user) but I’ve realized that the users that already registered using the actual api will no longer be able to login into their account… :skull:

5 Likes

Hi @neerja @NigelG @MrsHS and everyone.

It seems like I’m not the only one to look for a solution for a friction-less signup/login popup using LinkedIn.

Actually even beyond Linkedin, I’m looking for the best step-by-step tutorial or free plugin or template that describe how to let our users signup and login using their social accounts: Linkedin, Facebook, Twitter, Google, Apple.

Ideally I’d like to reuse their picture profiles and links to their social networks automatically to fill in their profile page in my app.

Thank you so much for your help. I am getting close to unveil my app to my first users and I need this friction-less signup popup with social accounts. I could consider removing entirely the username/password step and use only Linkedin or other social if easier to implement.

Thanks!
Sylvain

1 Like

Auth0.com is worth looking at.

hi notorioustech, have you figured out how to solve this?

I am about to start a LinkedIn integration for a client and will share my results here when I do. I hope it works without any problems :pray:. Shame that is not provided reliably out of the box in the bubble Eco-system

2 Likes

Nope.
The reason i was trying to use this method was due to two shortcomings of the builtin LI plugin: It doesn’t retrieve email and it was using up all the auth quota for the user as it was pinging LI every minute to verify they were still valid. I find it strange i was the only one to notice that bug as it rendered it unusable.
Since then:

  1. They changed the timer on it to every 10 minutes which helps, but i chose a different approach, moved my whole auth routine to another webapp. So basically i redirect to that app, trigger login, validate, LOGOUT and redirect back to the primary. Kind of like oauth to oauth. You probably don’t need to do this since the timer change.
  2. I don’t really need the email so changed my app to work around it.
2 Likes