Linkedin OAuth pictureUrl 导致 500 错误 [英] Linkedin OAuth pictureUrl leading to a 500 error

查看:24
本文介绍了Linkedin OAuth pictureUrl 导致 500 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到今天早上,在过去的 2 年里,我实施的 Linkedin Oauth 系统没有遇到任何问题.我可以验证所有数据仍然通过,但突然出现了一个非常奇怪的问题,返回数据的pictureUrl 参数.它不再指向图像,而是指向如下所示的页面:

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:

我无法弄清楚出了什么问题,任何建议将不胜感激.所有其他数据都很好.

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

推荐答案

问题似乎是当 OAuth 客户端请求的字段多于应用程序允许请求的字段时,LinkedIn OAuth API 返回 500 错误.可以通过指定特定的字段和范围来解决.

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.

根据最近在 GitHub 上的讨论 (https://github.com/auth0/passport-linkedin-oauth2/issues/24),指定具体的profileFieldsscope:

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

这篇关于Linkedin OAuth pictureUrl 导致 500 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆