ebx-linkedin-sdk icon indicating copy to clipboard operation
ebx-linkedin-sdk copied to clipboard

obtainUserAccessToken fails with HTTP 411

Open NMichas opened this issue 5 months ago • 0 comments

Hello, I'm trying to obtain the user access token with:

LinkedInClient client = new DefaultLinkedInClient(Version.DEFAULT_VERSION);
LinkedInClient.AccessToken newAccessToken = client.obtainUserAccessToken(clientId, clientSecret, redirectURI, code);

But fails with:

Caused by: com.echobox.api.linkedin.exception.LinkedInNetworkException: A network error occurred while trying to communicate with LinkedIn: LinkedIn request failed(HTTP status code 411)
	at com.echobox.api.linkedin.client.DefaultLinkedInClient.makeRequestAndProcessResponse(DefaultLinkedInClient.java:716) ~[ebx-linkedin-sdk-8.0.0.jar:na]
	at com.echobox.api.linkedin.client.DefaultLinkedInClient.makeRequestFull(DefaultLinkedInClient.java:581) ~[ebx-linkedin-sdk-8.0.0.jar:na]
	at com.echobox.api.linkedin.client.DefaultLinkedInClient.obtainUserAccessToken(DefaultLinkedInClient.java:420) ~[ebx-linkedin-sdk-8.0.0.jar:na]

It seems the client doesn't set Content-Length; is there something I may be missing here?

Thanks!

NMichas avatar Sep 18 '24 01:09 NMichas