Take the 2-minute tour ×

I am new to Python and Web2py and I am developing an app that will use the LinkedIn API.

I use this library http://code.google.com/p/python-linkedin/ (it includes OAuth). My problem is very strange and that's why I am writing to the list.

When I try to connect to LinkedIn from the web2py console I get a request Token. When I do it inside a HTTP request I get a signature invalid exception.

The code I use in both cases is quite simple:

  li = LinkedIn(LINKEDIN_API_KEY, LINKEDIN_SECRET_KEY, URL(r=request, c='default',f='import_accounts'))
share|improve this question
add comment

2 Answers

I just tried and it works but: 1) make sure you run this on the same hostname that you registered with linkedin 2) pass a full RETURN_URL, not a relative URL as returned by URL

def index():
  import linkedin
  from linkedin import linkedin
  RETURN_URL = "http://web2py.com/linkedin/default/hello"
  api = linkedin.LinkedIn(KEY, SECRET, RETURN_URL)
  token = api.requestToken()
  return dict(message=T('Hello World'),token=token)
share|improve this answer
The problem was that i was using behing a dynamic IP, i use now a tunnel and it works fine! –  PanosJee Feb 26 '10 at 12:40
add comment

You mentioned that in both cases it is quite simple... it leaves me to wonder.

Is it the exact same code in both cases?

share|improve this answer
yes but tomorrow when i started my computer it was working after 15-20 requests it stopped. i guess it should be ip or domain related problem –  PanosJee Feb 23 '10 at 22:37
add comment

Your Answer


