spring-social - Linkedin "Scope"未设置变量

标签 spring-social

我在使用 Spring Social 设置与 Linkedin Api 的连接时遇到问题。

我将“范围”变量“r_emailaddress”作为隐藏字段传递给表单以检索电子邮件地址,但它不起作用 - 我没有像您在此处那样看到 email_address 权限。 https://developer.linkedin.com/sites/default/files/gp-dialog.png

我正在关注 Spring Social Showcase 应用程序示例。我应该补充一点,社交应用程序没有隐藏范围字段。

在 Facebook 上运行良好。

表格

<form name="linkedinin_signin" id="linkedin_signin" action="${linkedin_uri}" method="POST">
    <input type="hidden" name="scope" value="r_basicprofile, r_emailaddress" />
    <input type="image" src="${linkedin_img_uri}" />
</form>

最佳答案

LinkedIn 是 OAuth 1.0a 提供者并且“scope”参数对于 OAuth 1.0(a) 是非标准的是正确的。因此,Spring Social 无法识别 OAuth 1.0(a) 提供程序的范围参数。

但是,您可能有兴趣知道昨天我对 Spring Social 进行了更改,允许将任意参数传递给请求 token URL 和授权 URL...包括“范围”参数。此更改相对较新,仅在最新的 1.1.0.BUILD-SNAPSHOT 版本中可用,但很快就会出现在 1.1.0.M2 中。这应该可以满足您的需求。

您可能还想查看 Spring Social Showcase 示例,因为它现在使用“scope”参数在用户连接到 LinkedIn 时请求“r_emailaddress”范围。

如果您对此更改有任何反馈,我将不胜感激,最好是对 https://jira.springsource.org/browse/SOCIAL-349 的评论或在 http://forum.springsource.org/forumdisplay.php?82-Social 的 Spring Social 论坛中. (我不像在 Spring Social 论坛上那样频繁地监视 StackOverflow 上的问题。)

关于spring-social - Linkedin "Scope"未设置变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14537022/

相关文章:

spring - 从 userProfile 检索到的电子邮件为空(Spring Social)

java - 如何在 MVC 配置中允许匿名 Twitter 连接

spring - 使用 spring 社交推特继续获得 401(需要授权)

spring - 寻找正确的方法 : Spring Social + Spring RESTful API + Spring WebApp + Mobile Clients

java - Spring 社交 Facebook 个人资料仅提供 ID 和姓名

spring - 由于 facebook 范围,无法使 spring-social-showcase-boot 工作?

java - 如何使用 spring social 以编程方式在 facebook 页面上发布?

java - 必须使用 Activity 访问 token 来查询有关当前用户的信息 - OAuthException Spring Social

java - 使用 spring social 为 Twitter 和 Facebook 创建 OAuth Flow

Android facebook 登录 Spring Social web 应用