Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linkedin OAuth pictureUrl leading to a 500 error

Until this morning, for the last 2 years I experienced no issues with the Linkedin Oauth system I have implemented. I can verify that all the data is still coming through, but suddenly a very strange issue has come up with the pictureUrl parameter of the returned data. It no longer leads to an image, and instead leads to a page which looks like this:

enter image description here

I can't figure out what has gone wrong, any advice would be greatly appreciated. All other data is coming through just fine.

like image 750
capcom-r Avatar asked Jan 04 '18 03:01

capcom-r


1 Answers

The issue seems to be that LinkedIn OAuth API returns a 500 error when the OAuth client asks for more fields than the application is permitted to request. It can be resolved by specifying the specific fields and scope.

Per this recent discussion at GitHub (https://github.com/auth0/passport-linkedin-oauth2/issues/24), specify the specific profileFields and scope :

{
    profileFields: [
                "formatted-name",
                "headline",
                "id",
                "public-profile-url",
                "email-address",
                "location"
            ],
    scope: ["r_basicprofile", "r_emailaddress"]
}
like image 90
prototype Avatar answered Oct 16 '22 19:10

prototype