rest - Linkedin OAuth2 authorization code error -
i´m trying connect via linkedin auth2 java web application:
- added own app in linkedin.
- 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
- introduce login/password linkedin in new popup.
- get successful request on redirect_uri previus, , take authorization code "code"
- generate accesstoken url
- 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
- 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
Post a Comment