1

I'm having trouble using the LinkedIn API due to being returned a 401 with auth_problem=signature_invalid. I do however have a project which seems to be working with fine so I'm using this to identify the differences.

I read that I can debug with the OAuthTestConsole however this appears to be generating a different signature than the working project.

Since I'm this is only a hobby you can have both my keys:

API Key: gh69xphn2hcr
Secret Key: 0ld6NVvjmpvrmZqw

My working request is:

POST https://api.linkedin.com/uas/oauth/requestToken HTTP/1.1
Content-Type: application/x-www-form-urlencoded Host: api.linkedin.com
Content-Length: 175
Connection: Keep-Alive

oauth_consumer_key=gh69xphn2hcr&oauth_nonce=186481&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1325243837&oauth_version=1.0&oauth_signature=gTeEgzknW6DyI3aFTDcXduroIG4%3d

However the oAuthTestConsole returns an oauth_signature of WNcZFXAC5Y2hoK4srFiFc69zi0M= which is nothing alike (encoded or not).

I'm thinking I must be using the TestConsole wrong and this is preventing me from fixing my issue between the working / non working projects. Could you please point me in the right direction as to why this might occur?

Charles
  • 50,943
  • 13
  • 104
  • 142
m.edmondson
  • 30,382
  • 27
  • 123
  • 206

1 Answers1

0

To use the OAuth Test Console, you need to make sure that all of the parameters are exactly the same - the timestamp (you'll need to set that manually, as it'll otherwise be created based on the current time) - the nonce (check to see what your library is sending) - the method (POST in this case)

You need to clear both fields for the access_token (since you don't have one for this initial request)

There is a working C# example posted by a community member here: https://developer.linkedin.com/thread/1190

Many people have had a lot of luck starting with that, as using OAuth can be tricky without an example to start from.

Kirsten Jones
  • 2,681
  • 1
  • 17
  • 20