I am having the same issue as John, i.e. the python linked library
works from the python interpreter but gives signature_invalid error
when run on GAE development server or production server.
I rewrote the library to use urlfetch directly, instead of urllib, but
I got the same error.
It is true that urlfetch changes headers, but those do not enter the
signature calculation.
On Aug 4, 11:44 pm, Chris Copeland <
ch...@cope360.com> wrote:
> Hi John,
>
> This is a just a guess since I haven't used that library: when you're
> running in GAE, urllib (which the linkedin lib uses) is actually a wrapper
> for GAE's URL Fetch. GAE's URL Fetch removes some headers and adds others.
> If any of those headers are included in generating the checksum, then that
> would be your problem.
>
> -Chris
>
> On Thu, Aug 4, 2011 at 8:36 AM, John OBrien <
john.obr...@job-buddy.com>wrote:
>
>
>
>
>
>
>
> > Hiya,
>
> > I'm a bit of a newbie, so I apologize if the answer to this question is
> > obvious. I'm having a bit of trouble using the python linkedin library (
> >
http://code.google.com/p/python-linkedin/).
>
> > When I attempt to use the library from an interactive Python interpreter,
> > it works great:
>
> > import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
> > /Library/Frameworks/Python.
> > framework/Versions/2.5/**Resources/Python.app/Contents/**MacOS/Python
> > 2.5.4 (r254:67917, Dec 23 2008, 14:57:27)
> > [GCC 4.0.1 (Apple Computer, Inc. build 5363)]
> > >>KEY = "xxxxxx"
> > >>SECRET = "xxx"
> > >>RETURN_URL = "
http://localhost:8080/**settings/linkedin/return<
http://localhost:8080/settings/linkedin/return>
> > "
> > >>from linkedin import linkedin
> > >>api = linkedin.LinkedIn(KEY, SECRET, RETURN_URL)
> > >>result = api.requestToken()
> > >>print result
> > True
> > >>print api.getRequestTokenError()
> > None
>
> > However, when I wrap a Google App Engine webapp.RequestHandler around it, I
> > get an error:
>
> > from linkedin import linkedin
>
> > from google.appengine.ext import webapp
> > from google.appengine.ext.webapp.**util import run_wsgi_app
>
> > class LinkedInSettings(webapp.**RequestHandler):
> > def get(self):
> > KEY = "xxxx"
> > SECRET = "xxxx"
> > RETURN_URL = "
http://localhost:8080/**settings/linkedin/return<
http://localhost:8080/settings/linkedin/return>
> > "
> > api = linkedin.LinkedIn(KEY, SECRET, RETURN_URL)
> > result = api.requestToken()
> > print result
> > print api.getRequestTokenError()
>
> > application = webapp.WSGIApplication([('/settings/linkedin.*',
> > LinkedInSettings)])
>
> > def main():
> > run_wsgi_app(application)
>
> > if __name__ == "__main__":
> > main()
>
> > This a request tohttp://localhost:8080/settings/linkedinwill print out: