Closed JSteunou closed 7 years ago
@JSteunou *\ I will remove this comment.
I am only getting "pictureUrl" in response and not "pictureUrls" or "picture-urls::(original)". Any idea how i can get the full image?
Hi @oieesah, please check the following:
passport-linkedin-oauth2@1.4.x
My Apps
-> {YOUR_APP_NAME}
-> Default Application Permissions
: Enable r_basicprofile
LinkedInStrategy
settings: make sure to include scope: [ 'r_basicprofile' ]
Then pictureUrls
should be available in profile._json
object.
@siacomuzzi I have verified both of these points.
The response i am getting is this:
{ emailAddress: 'haseebkhilji@gmail.com', firstName: 'Haseeb', headline: 'Student', id: 'pTTFC8Wm7-', industry: 'Computer Software', lastName: 'Ahmad', location: { country: [Object], name: 'Pakistan' }, pictureUrl: 'https://media.licdn.com/mpr/mprx/0_ORAOgKuovqDjSz0_AEbKVN9oPqYjHN0-cRWOZkion5-yHXY-U05xnC3oK5GjH5-0UDd11kCEs_fpwrBY-eqGvkfQ0_fgwrV0BeqjY5VwqCVAT63_RJCPOAqsx9zSGrSaOIK-JURSaxs', publicProfileUrl: 'https://www.linkedin.com/in/haseeb-ahmad-52b11455' }
You can see, not pictureUrls.
Check profile._json
object (https://github.com/auth0/passport-linkedin-oauth2/blob/master/lib/oauth2.js#L48-L50)
Yes i did.
Following is the complete "profile" object (including ._json):
{ provider: 'linkedin', id: 'pTTFC8Wm7-', displayName: 'Haseeb Ahmad', name: { familyName: 'Ahmad', givenName: 'Haseeb' }, emails: [ { value: 'haseebkhilji@gmail.com' } ], _raw: '{\n "emailAddress": "haseebkhilji@gmail.com",\n "firstName": "Haseeb",\n "headline": "Student",\n "id": "pTTFC8Wm7-",\n "industry": "Computer Software",\n "lastName": "Ahmad",\n "location": {\n "country": {"code": "pk"},\n "name": "Pakistan"\n },\n "pictureUrl": "https://media.licdn.com/mpr/mprx/0_ORAOgKuovqDjSz0_AEbKVN9oPqYjHN0-cRWOZkion5-yHXY-U05xnC3oK5GjH5-0UDd11kCEs_fpwrBY-eqGvkfQ0_fgwrV0BeqjY5VwqCVAT63_RJCPOAqsx9zSGrSaOIK-JURSaxs",\n "publicProfileUrl": "https://www.linkedin.com/in/haseeb-ahmad-52b11455"\n}', _json: { emailAddress: 'haseebkhilji@gmail.com', firstName: 'Haseeb', headline: 'Student', id: 'pTTFC8Wm7-', industry: 'Computer Software', lastName: 'Ahmad', location: { country: [Object], name: 'Pakistan' }, pictureUrl: 'https://media.licdn.com/mpr/mprx/0_ORAOgKuovqDjSz0_AEbKVN9oPqYjHN0-cRWOZkion5-yHXY-U05xnC3oK5GjH5-0UDd11kCEs_fpwrBY-eqGvkfQ0_fgwrV0BeqjY5VwqCVAT63_RJCPOAqsx9zSGrSaOIK-JURSaxs', publicProfileUrl: 'https://www.linkedin.com/in/haseeb-ahmad-52b11455' } }
you are using passport-linkedin-oauth2@1.4.x
, right?
please put a console.log(this.profileUrl)
here: https://github.com/auth0/passport-linkedin-oauth2/blob/master/lib/oauth2.js#L19 and show us the output.
I have copied this response from console. Yes i have download this module today. To be more specific, i am using "passport-linkedin-oauth2": "~1.4.1"
please put a console.log(this.profileUrl)
here: https://github.com/auth0/passport-linkedin-oauth2/blob/master/lib/oauth2.js#L19 and show us the output.
looks good.
could you please try with another linkedin user?
@siacomuzzi Good point, Sure.
@siacomuzzi Same result.
These are my strategy options:
{ scope: [ 'r_basicprofile' ],
clientID: '...',
clientSecret: '...',
callbackURL: 'https://mywebapp.com/login/callback' }
my this.profileUrl
value:
https://api.linkedin.com/v1/people/~:(id,first-name,last-name,picture-url,picture-urls::(original),formatted-name,maiden-name,phonetic-first-name,phonetic-last-name,formatted-phonetic-name,headline,location:(name,country:(code)),industry,distance,relation-to-viewer:(distance,connections),current-share,num-connections,num-connections-capped,summary,specialties,positions,site-standard-profile-request,api-standard-profile-request:(headers,url),public-profile-url)
And my profile._json
object:
{
// ...
pictureUrl: 'https://media.licdn.com/mpr/mprx/...',
pictureUrls: { _total: 1, values: [Object] },
}
Maybe you can try with a new LinkedIn app?
Alright. I will let you know.
Created new LinkedIn app. The response is same as before. No "pictureUrls" exist.
Is linkedin expose the same API or same version to everyone, every country ?
Le 10 août 2016 11:04, "Haseeb" notifications@github.com a écrit :
Created new LinkedIn app. The response is same as before. No "pictureUrls" exist.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/auth0/passport-linkedin-oauth2/issues/41#issuecomment-238808034, or mute the thread https://github.com/notifications/unsubscribe-auth/ACNytw1JDcweruYyAq2HWf-bjokTbLNgks5qeZQigaJpZM4IhYjj .
@JSteunou Sorry, i didn't get your question.
@siacomuzzi Which version of "Passport" you are using?
@oieesah I mean, it's weird that some of us get pictureUrls
and you do not despite your different tests. So I though, maybe it's not the same API version. Or maybe LinkedIn do not send the same result depending the country we set in our profile due to local laws...
@JSteunou That's not possible, linkedIn is a global service so does it's API.
Which version of "Passport" you are using?
passport-linkedin-oauth2@1.4.1
I just created a new LinkedIn app and its works as expected:
On a side note, can we get profile photo without linkedin watermark on them?
Check LinkedIn API documentation, but I think you can't do that.
Does full photo from "pictureUrls::(Original)" also contains watermark?
yes, bottom-right corner
@siacomuzzi
"picutreUrls.values[0]" value is same as "pictureUrl"?
I am talking in reference to the response you shared.
No. pictureUrls.values[0]
is the original unformatted profile picture. From doc:
picture-url
): A URL to the member's formatted profile picture, if one has been provided.picture-urls::(original)
): A URL to the member's original unformatted profile picture. This image is usually larger than the picture-url value above.@siacomuzzi I have tried almost all options there is.
But not getting "picture-urls".
Try submitting your issue in LinkedIn Dev Support
@siacomuzzi How i can validate whether my app is making oauth2 call or not?
Sorry, I don't understand the question. If you are using passport-linkedin-oauth2
, then you are making oauth2 calls (https://www.linkedin.com/uas/oauth2/authorization and https://www.linkedin.com/uas/oauth2/accessToken)
I am using passport-linkedin-oauth2. My response is same as the one i was getting with passport-linkedIn. So i thought may be my web-app isn't really making OAuth2 calls at all.
@siacomuzzi My app is authorising with linkedIn using https://www.linkedin.com/uas/oauth/authorize?oauth_token=
Why not oauth2? May be this the reason i was not getting the pictureUrls.
Please debug your app, if you are using passport-linkedin-oauth2
, initial request should be https://www.linkedin.com/uas/oauth2/authorization
(see https://github.com/auth0/passport-linkedin-oauth2/blob/master/lib/oauth2.js#L8)
Thanks @siacomuzzi
@oieesah can I close this issue?
@siacomuzzi Yes sure!
@siacomuzzi when displaying the pictureUrl in Image tag in react native it is not displaying in android but showing in ios How to solve this?
linkedin also return
pictureUrls
which is likecould be used in profile
photos
attribute.