Reputation: 752
I have used Spring social for integration with linkedin.
When the integration completes we save the users profile image which has below url:
But this url is giving access denied error. Is there something I am missing?
Upvotes: 0
Views: 3817
Reputation: 107
I looked at the URL of my picture of my In Public profile and the one returned from the API.
The picture URL in the XML returned after the ?
for params v
and t
had & ;
instead of &
:
e.g.
https://media.licdn.com/.../profile-displayphoto-shrink_200_200/0?e=152800"&";v=beta"&";t=LJTrw_oj9npH06X1u0HjQ
Replacing it with something like:
pictureURL = pictureURL.replaceAll("& ;","&");
fixed the issue for me. Hope this helps
Note that there is an extra space between &
and ;
. It would have formatted otherwise.
Upvotes: 2
Reputation: 2435
This may help, As per https://developer.linkedin.com/docs/ref/v2/media-migration,
The new id will be dynamic and can change from time to time. We recommend retrieving at least once every 60 days to update your media-typed URN.
This could be one of the issue which you might be facing.
In order to fix this, I save the image, the moment it is received on to personal storage(AWS S3).
Upvotes: 4