linkedin-apispring-socialspring-social-linkedin

Getting 410 error when using Spring social LinkedIn


I'm using spring-social-linkedin v2.0.0.M2 and I have Oauth via Linkedin. When completing the authorization, Spring Social does the following request (git that from debugging):

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

And I get a 410 error The stacktrace is:

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)

I see that the API version is v1 and it has been deprecated. But is that already gone? The Oauth used to work fine till the recent time. If the v1 API is already gone, is there a way to override the obsolete URLs in the Spring Social library?


Solution

  • The Spring Social Project is no longer supported, so it is better to migrate to the new version of Spring Social with all the features that Spring Social used to provide