rest - Linkedin OAuth2 authorization code error -


i´m trying connect via linkedin auth2 java web application:

  1. added own app in linkedin.
  2. generate authorization url: https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxx&scope=r_basicprofile%20r_fullprofile%20r_emailaddress&state=dceefwf454us5dffef424&redirect_uri=http://localhost:9090/springmvc/token.htm
  3. introduce login/password linkedin in new popup.
  4. get successful request on redirect_uri previus, , take authorization code "code"
  5. generate accesstoken url
  6. make post with: https://www.linkedin.com/uas/oauth2/accesstoken?grant_type=authorization_code&code=yyy&redirect_uri=http://localhost:9090/springmvc/token.htm&client_id=xxx&client_secret=zzz
  7. get next error in response: {"error_description":"missing required parameters, includes invalid parameter value, parameter more once. : unable retrieve access token : appid or redirect uri not match authorization code or authorization code expired","error":"invalid_request"}

i´ve verified url parameters correct: - "code" token receive on step 4.

  • "redirect_uri" same url on step 2 , 4. added url on section "oauth 2.0 redirect url" on app.

  • "client_id" , "client_secret" "client api" , "secret api" on app.

  • time between first , second request less 20 seconds.

the value of redirect_uri parameter must url-encoded, @ 6. do:

 https://www.linkedin.com/uas/oauth2/accesstoken?grant_type=authorization_code&code=yyy&redirect_uri=http%3a%2f%2flocalhost%3a9090%2fspringmvc%2ftoken.htm&client_id=xxx&client_secret=zzz 

and need not sent post get.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -