Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on Linkedin: Undefined array key "storageSize" #669

Closed
alkin opened this issue Oct 13, 2023 · 6 comments · Fixed by #671
Closed

Exception on Linkedin: Undefined array key "storageSize" #669

alkin opened this issue Oct 13, 2023 · 6 comments · Fixed by #671

Comments

@alkin
Copy link

alkin commented Oct 13, 2023

Socialite Version

5.8.1

Laravel Version

9.52

PHP Version

8.2

Database Driver & Version

No response

Description

A small set of Users are getting an exception when trying to connect with Linkedin. I believe Linkedin is not returning the avatar image as expected by Socialite.

image

My suggestion is to simply ignore this error using "@" before the expression:

return @$image['data']...

Steps To Reproduce

We couldn't find a way to reproduce the bug. But this affects specific users every time. Probably there is something different with their accounts or avatars, so that linkedin API returns a slightly different data.

@alkin alkin changed the title Exception on Linkedin Exception on Linkedin: Undefined array key "storageSize" Oct 13, 2023
@shahedgain
Copy link

shahedgain commented Oct 15, 2023

I'm also facing the same issue.
Found out the storageSize key is replaced by displaySize in LinkedIn response.

@github-actions
Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@driesvints
Copy link
Member

Are you sure you don't need to use the openid linkedin provider instead of the regular one?

@alkin
Copy link
Author

alkin commented Oct 16, 2023

I guess i could use the OpenID provider but i believe that wouldn't solve the problem for the regular provider.

We have been using the regular LinkedIn provider for years on this specific project without problems. Without any changes to our code, we started experiencing the exception described. This means that Linkedin changed their behavior and how avatar images are saved internally. We should update socialite to consider this change. Otherwise, i believe more and more people will start to experience the issue, as Linkedin moves to this new data structure.

I will test the OpenID provider soon and post here the results.

@driesvints
Copy link
Member

Feel free to re-open if the openid provider didn't solve your problem 👍

@mukes555
Copy link

facing same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants