我目前正在使用Spring Social LinkedIn 1.0.0.请将用户登录到我的网站.我有一个功能,我需要访问用户的项目.目前,我没有办法访问他们的项目.我查看了Spring Social LinkedIn代码,发现无法检索此数据.我能够构建一个休息端点来获取访问权限并构建一个原始映射器来返回一个Java对象.我正在等待Spring Social LinkedIn社区的正确实施.我想我会查看是否有任何计划构建api来获取用户的项目.获取项目的其余网址如下:
谢谢,
Sajid
我期待开发Spring MVC + Apache Oltu + Linkedin集成示例.在此示例中,您需要发送客户端ID和客户端密钥以从站点中的链接访问私有资源.
第一步 - 我们需要在Linkedin中创建App,请按照以下步骤操作:http://codeboxr.com/how-to-create-linkedin-app.html
创建应用程序后,您需要确保为重定向URL指定了值.
在java代码中我使用了setScope("r_network w_share r_basicprofile")setState("987654321")
当我使用以下代码时:
request= new OAuthBearerClientRequest("https://api.linkedin.com/v1/people/").buildQueryMessage();
Run Code Online (Sandbox Code Playgroud)
我得到以下错误.有人可以吗?
Could not access resource: 401 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<status>401</status>
<timestamp>1429554559432</timestamp>
<request-id>QJWNLL5PWX</request-id>
<error-code>0</error-code>
<message>Unknown authentication scheme</message>
</error>
Run Code Online (Sandbox Code Playgroud)
重要的是,我在下面得到了正确的详细信息,但似乎访问私人资源:
{"access_token":"SQXZVmVM05AOzDB_DdBm5iaJkrEC8oK-FgE1m1snEZbMcKUODew9I0ZQ6NWc8JtGDxTtEd-yyPul0FtF3-hG4ah6LZ9P4oaSVuhhtybRFmjfsZcJwOs5Lm2IDUGQnjmq5EdT3PVR7Bocq31VBXg0JtkQdImab945oicO_w2j6CjlByp-bWw",
"expires_in":5108376}
Run Code Online (Sandbox Code Playgroud) 最近,我的“使用 Linkedin 登录”功能开始出现问题。我收到以下错误:
Uncaught TypeError: Cannot read property 'then' of undefined at Object.authorize (in.js:18)
我确实在应用程序的 OAuth 2.0 设置中正确定义了重定向 URL。
我的 LinkedIn 应用程序列出了以下权限:
这是我的代码:
<script type="application/javascript">
//This will be re-defined where it is needed
var linkedInAPILoaded = function(){};
</script>
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
api_key: ${apiKey}
authorize: true
onLoad: linkedInAPILoaded
lang: en_US
</script>
<form name="li_signin" class="li_signin" action="<c:url value='/signin/linkedin'/>" method="post">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<a id="linkedInIcon" href="javascript:;" aria-label="<spring:message code="oa.social.linkedin.login"/>">
<i class="glyphicon glyphicon-refresh gly-spin hidden"></i>
<img src="<c:url value='/images/In-2C-48px-R.png'/>" alt="<spring:message …Run Code Online (Sandbox Code Playgroud) javascript linkedin-jsapi spring-social-linkedin linkedin-api