Reputation: 33
I´m trying to connect via Linkedin Auth2 from a java web application:
I´ve verified url parameters are correct: - "code" is the token receive on step 4.
"redirect_uri" is the same URL on step 2 and 4. I added this URL on section "OAuth 2.0 redirect URL" on my APP.
"client_id" and "client_secret" are the "Client API" and "Secret API" on my APP.
Time between first and second request is less than 20 seconds.
Upvotes: 3
Views: 9911
Reputation: 77
If You Are Sending a Request For Access Token it must be POST Request
I actually Copied the Whole URL From My Eclipse Console To URL It is Still Valid
In Your Case The Problem is with URL Encoding As HanZ said . You Have to Encode Your URL For Post Request.
Upvotes: 1
Reputation: 950
I too got bugged with this issue for long time. Please keep few things in mind which I did and eventually sorted it out.
I assume that all the other parameters like client_id, secret, redirect_uri are correct.
please try and let us know.
Thanks.
Upvotes: 0
Reputation: 53888
The value of your redirect_uri
parameter must be URL-encoded, so at 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 it need not be sent as a POST but as a GET.
Upvotes: 4