I'm able to get all my tokens and all appears to be working, but when I try to get info from the people api, I get an unauthorized response. I've pored over all the docs I could find (including the zero-to-hero slideshow from Taylor Singletary: http://www.slideshare.net/episod/linkedin-oauth-zero-to-hero) and I can't seem to find what I'm doing wrong.I'm working on this locally on the dev_server of a google app engine python application using the webapp framework.Here's the request I'm sending (from the debug console):Making HTTP request: host = api.linkedin.com, url = https://api.linkedin.com/v1/people/~?oauth_nonce=3228209849670894546&oauth_timestamp=1295992693&oauth_consumer_key=v0B8v4vPtW1H9d_Z38UuArsR1iCXdlBxflF4c-K8Oeqwor2LtvJNldRe3uMqKu_7&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_token=b03477a7-f974-4d50-8630-590367ea5d15&oauth_signature=7iUtT2b7mjeo3%2FhGBEw8FwJjMxI%3D, payload = None, headers = {'Host': 'api.linkedin.com', 'X-Li-Format': 'json', 'Accept-Encoding': 'gzip', 'Authorization': 'OAuth oauth_nonce="3228209849670894546", oauth_timestamp="1295992693", oauth_consumer_key="v0B8v4vPtW1H9d_Z38UuArsR1iCXdlBxflF4c-K8Oeqwor2LtvJNldRe3uMqKu_7", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token="b03477a7-f974-4d50-8630-590367ea5d15", oauth_signature="7iUtT2b7mjeo3%2FhGBEw8FwJjMxI%3D"', 'User-Agent': 'AppEngine-Google; (+http://code.google.com/appengine)'}The base string for the signature generated in this request is:GET&https%3A%2F%2Fapi.linkedin.com%2Fv1%2Fpeople%2F%7E&oauth_consumer_key%3Dv0B8v4vPtW1H9d_Z38UuArsR1iCXdlBxflF4c-K8Oeqwor2LtvJNldRe3uMqKu_7%26oauth_nonce%3D3228209849670894546%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1295992693%26oauth_token%3Db03477a7-f974-4d50-8630-590367ea5d15%26oauth_version%3D1.0The first thing I checked was Authorization header. That's in that request above but I'll break them out here so it's easier to read:'Authorization': 'OAuth oauth_nonce="3228209849670894546", oauth_timestamp="1295992693", oauth_consumer_key="v0B8v4vPtW1H9d_Z38UuArsR1iCXdlBxflF4c-K8Oeqwor2LtvJNldRe3uMqKu_7", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token="b03477a7-f974-4d50-8630-590367ea5d15", oauth_signature="7iUtT2b7mjeo3%2FhGBEw8FwJjMxI%3D"'Also I am building the signing key by concatenating the url-escaped consumer-secret and auth-token-secret with an ampersand in the middle as the docs show. So all of that seems correct to me (and my computer's clock is correct as well), but here's the response I get from this request:{u'status': 401, u'timestamp': 1295992693380L, u'message': u'[unauthorized]. OAU:v0B8v4vPtW1H9d_Z38UuArsR1iCXdlBxflF4c-K8Oeqwor2LtvJNldRe3uMqKu_7|b03477a7-f974-4d50-8630-590367ea5d15|*01|*01:1295992693:7iUtT2b7mjeo3/hGBEw8FwJjMxI=', u'errorCode': 0}In case this is a factor, at the point that I get the user info response (slide 24 or Zero to Hero), I am getting a couple of additional parameters that say my auth session has already expired. That doesn't sound right, but I can't find any info about that in your docs.oauth_token=b03477a7-f974-4d50-8630-590367ea5d15&oauth_token_secret=[seems like i should hide this secret in this post :-)]&oauth_expires_in=0&oauth_authorization_expires_in=0If that's a problem I'm not sure what it indicates or what I can do about it. Can someone please help me with some direction on what to do here? I've spent a lot of time spinning wheels and would really appreciate some help getting this to work.
- Log in to post comments
Bob, What OAuth library are you using? Are you using python or java? If you give us a little more information about how you're trying to go about this we can probably point you in the right direction :-)Thanks,Kirsten