Linkedin Oauth giving me error

HI guys
i am trying to implement linkedin Oauth flow as below

but it is giving me the following error and need help to solve this issue

linkedin error

any help would be appreciated
Thanks

Correc turl for userinfo is: https://api.linkedin.com/v2/userinfo
Id key path should be sub

1 Like

Id key path should be sub i did not get this u want to say i should put sub instead of id?

1 Like

exactly.
userinfo payload is:

{
    "sub": "782bbtaQ",
    "name": "John Doe",
    "given_name": "John",
    "family_name": "Doe",
    "picture": "https://media.licdn-ei.com/dms/image/C5F03AQHqK8v7tB1HCQ/profile-displayphoto-shrink_100_100/0/",
    "locale": "en-US",
    "email": "doe@email.com",
    "email_verified": true
}

m sorry if i sound dumb but where will i find this payload?

This is all in linkedin auth documentation

now it gives me following error

API Connector error: the Oauth2 API LinkedIn is not configured properly - Received error from api The service LinkedIn just returned an error (HTTP 403). Please consult their documentation to ensure your call is setup properly. Raw error:

{“serviceErrorCode”:100,“message”:“Not enough permissions to access: GET /userinfo”,“status”:403}

you may need openid scopes. But there’s also another endpoint available with oauth2 for userinfo

https://api.linkedin.com/v2/me

this endpoint will have the id under id and not sub in this case.
Be sur to have all needed scopes set

1 Like

the complete scopes for the profile I first provided are: openid email profile

well i have dont it the authentication process and it is successful now …

but giving me an error while i am trying to fetch email using following endpoint
https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)

and the error goes like
Status code 500 {“serviceErrorCode”:0,“message”:“java.lang.StringIndexOutOfBoundsException: String index out of range: 19”,“status”:500}

I think you have a missing ) at the end
try to url encode the projection parameter maybe?

I think you have a missing ) at the end - spot on…thank you for observing and this is why i love forum

appreciate your help sir…thank you once again

1 Like

But how come it is not showing email in database email field?

This topic was automatically closed after 70 days. New replies are no longer allowed.