capcom-r
capcom-r

Reputation: 105

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.

Upvotes: 6

Views: 1295

Answers (1)

prototype
prototype

Reputation: 7965

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"]
}

Upvotes: 1

Related Questions