Question

final LinkedInOAuthService oauthService = LinkedInOAuthServiceFactory.getInstance().createLinkedInOAuthService(consumerKeyValue, consumerSecretValue);
LinkedInRequestToken requestToken = oauthService.getOAuthRequestToken(callbackUrl);
session.setAttribute("requestToken", requestToken);
String authUrl = requestToken.getAuthorizationUrl(); 
return new ModelAndView("redirect:" + authUrl);

I am using the above code block to make user grant permission to my application from LinkedIN. The authorization screen is appearing everytime when I redirect user to authURL with the same default scope. Not able to figure out if I am missing anything here.

Was it helpful?

Solution

You should change your OAuth endpoint from https://www.linkedin.com/uas/oauth/authorize to https://www.linkedin.com/uas/oauth/authenticate. This should work for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top