我正在使用 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?