Note that there are some explanatory texts on larger screens.

plurals
  1. POOAuth: HTTP 401 Status when trying to get access token to LinkedIn
    text
    copied!<p>Using <a href="http://code.google.com/p/linkedin-j/" rel="nofollow">linkedin-j</a>, I have the following code in one part of my application</p> <pre><code>LinkedInOAuthService service = LinkedInOAuthServiceFactory.getInstance() .createLinkedInOAuthService(consumerKey, consumerSecret); LinkedInRequestToken requestToken = service.getOAuthRequestToken(linkedinCallbackURL); String authUrl = requestToken.getAuthorizationUrl(); </code></pre> <p>I redirect to the page pointed by <code>authUrl</code> and get to the correct LinkedIn page where I authorize my application. Then, the code which generates the page pointed by <code>linkedinCallbackURL</code> will execute this:</p> <pre><code>String verifier = request.getParameter("oauth_verifier"); LinkedInOAuthService oauthService = LinkedInOAuthServiceFactory.getInstance() .createLinkedInOAuthService(consumerKey, consumerSecret); LinkedInRequestToken requestToken = oauthService.getOAuthRequestToken(); LinkedInAccessToken accessToken = oauthService .getOAuthAccessToken(requestToken, verifier); </code></pre> <p>Unfortunately, I get this error:</p> <blockquote> <p>com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Server returned HTTP response code: 401 for URL: <a href="https://api.linkedin.com/uas/oauth/accessToken" rel="nofollow">https://api.linkedin.com/uas/oauth/accessToken</a></p> <p>Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Server returned HTTP response code: 401 for URL: <a href="https://api.linkedin.com/uas/oauth/accessToken" rel="nofollow">https://api.linkedin.com/uas/oauth/accessToken</a></p> </blockquote> <p>What can be wrong?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload