Sign in with LinkedIn


(Emily) #1

Matrix Version: 5.5.2

Hey Squizee’s,

I am trying to setup a create-user-account via LinkedIn profile, based on the Facebook Sign-In tutorial (which is great, by the way!), but am becoming stuck because LinkedIn have separate the r_liteprofile (which is id, firstname, lastname) from the r_emailAddress . I want both, but they have different request URIs.

https://api.linkedin.com/v2/me
https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))

Is there I way I can fetch both in the one OAuth call?
Or should I be doing this some other way?

Not sure if it is related or unrelated, but when I test the login for just using the r_liteprofile ( /me ) information, it always returns a message in the Matrix pop-up window “Can not locate the userid in the response of profile API.” I have tried keep it the default " id ", as well as manually inputting " id " and " personId " and " personID " – it makes no difference. Yet there should be an id field returned by /me in the default response. I have also tried by specifying id to be returned too, same error.

I’m not very knowledgable with integrations - a learning curve - but I can follow steps-by-step in laymen’s terms. (e.g. the Facebook tutorial)

Thank you in advance :slight_smile:
Emily


(Emily) #2

No one successfully setup to login with LinkedIn ID’s using both the Email and their Name?


(Bart Banda) #3

Hey Emily, did you get anywhere with this? I haven’t tried logging in with LinkedIn before, never used their OAuth API before, but did you have a look at this tutorial? https://matrix.squiz.net/tutorials/2015/example

It’s a bit old now and outdated, the LinkedIn API might have changed since then, but might give you some pointers?


(Emily) #4

Hi Bart,
Yes, I had used a combination of that tutorial and the Facebook Login tutorial (https://matrix.squiz.net/tutorials/2019/how-to-implement-single-sign-on-with-facebook).

I haven’t worked on it much since September, since there wasn’t any responses, so it’s on the back-burner for now. I just tried it again now, using the REST Resource as per the Linked In Tutorial (updating to current URLs needed), and the “Linked in wants to access…” came up fine, but once it returns me to the page, there isn’t any data presented.

I am still getting the “can not locate the userid” problem in my other configuration.


(Bart Banda) #5

Hmmm, hard to say without knowing more how the LinkedIn API works. Maybe play around with the scope field to make sure you are requesting the right data. The other thing to ensure is right is the User Profile API field and User ID Location field are configured to find the user id in the right place of the response (https://matrix.squiz.net/tutorials/2019/how-to-implement-single-sign-on-with-facebook#matrix-setup_setup-oauth-account-manager-asset)