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)


(Emily) #6

Thanks Bart.
Having another look at it today, after a long time.
I can get the REST Resource to produce the pop-up to allow me to “Allow Access” to my Linked In account, but then the page displays nothing.

I have a Standard Page I was using to have a Sign In with Linked In button, and it gets to the same stage using the REST Resource. But when I am logged in with Linked it, it won’t display even my First Name or Last Name. I can’t remember where I got the Keywords from, But I am using:
%globals_session_oauth_profile_first_name% for the firstname output - which isn’t working.

I have also linked an OAuth Account Manager into the process, but it doesn’t seem to create an account that I can see. It has problems connecting with Linked In - something about a Redirect URI - perhaps need to add the URL into Linked In for security. Not an issue at this stage, still stuck on the previous bit.

Still have the issue that I need to be able to submit 2 different SCOPES at the same time to get all the data I need. Is this possible in the OAuth Token? (What formatting do I need to separate them?)
(Emails are not stored in the same scope as Name and other profile data).


(Bart Banda) #7

Hey Emily, how did you go? Any luck?

To pass multiple scopes, just separate them by a comma in the Scope field OAuth 2 Token asset.