使用Spring社交LinkedIn时出现410错误

时间:2019-05-24 17:35:37

标签: linkedin linkedin-api spring-social spring-social-linkedin

我正在使用spring-social-linkedin v2.0.0.M2,并且通过Linkedin获得了Oauth。完成授权后,Spring Social会执行以下请求(来自调试的git):

https://api.linkedin.com/v1/people/~:(id,first-name,last-name,emailAddress,headline,industry,site-standard-profile-request,public-profile-url,picture-url,summary)?format=json

我收到410错误 堆栈跟踪为:

org.springframework.social.UncategorizedApiException: 
    at org.springframework.social.linkedin.api.impl.LinkedInErrorHandler.handleUncategorizedError(LinkedInErrorHandler.java:62)
    at org.springframework.social.linkedin.api.impl.LinkedInErrorHandler.handleError(LinkedInErrorHandler.java:55)
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:700)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:653)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:628)
    at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:303)
    at org.springframework.social.linkedin.api.impl.ProfileTemplate.getUserProfile(ProfileTemplate.java:123)
    at org.springframework.social.linkedin.api.impl.ProfileTemplate.getUserProfile(ProfileTemplate.java:88)
    at org.springframework.social.linkedin.connect.LinkedInAdapter.setConnectionValues(LinkedInAdapter.java:43)
    at org.springframework.social.linkedin.connect.LinkedInAdapter.setConnectionValues(LinkedInAdapter.java:30)
    at org.springframework.social.connect.support.AbstractConnection.setValues(AbstractConnection.java:175)
    at org.springframework.social.connect.support.AbstractConnection.initKey(AbstractConnection.java:137)
    at org.springframework.social.connect.support.OAuth2Connection.<init>(OAuth2Connection.java:75)
    at org.springframework.social.connect.support.OAuth2ConnectionFactory.createConnection(OAuth2ConnectionFactory.java:94)
    at org.springframework.social.connect.web.ConnectSupport.completeConnection(ConnectSupport.java:161)
    at org.springframework.social.connect.web.ConnectController.oauth2Callback(ConnectController.java:291)

我看到该API版本是v1,并且已弃用。但是那已经消失了吗?直到最近,Oauth都可以正常工作。如果v1 API已经不存在,是否有办法覆盖Spring Social库中的过时URL?

1 个答案:

答案 0 :(得分:0)

不再支持Spring Social Project,因此最好迁移到具有Spring Social过去提供的所有功能的Spring Social新版本