You can try with oauth10a_account.py login method, it should work.  I
did not have time yet to put an example application on line,
but it is very similar to twitter.

http://code.google.com/r/michelecomitini-facebookaccess/source/browse/#hg/applications/helloTwitter

I will put the linkedin example online soon...

mic

2010/10/9 Carl Roach <carl.ro...@gmail.com>:
> Thanks M. I'll look into that but I will need full access to LinkedIn (name, 
> company, contacts)
>
> I'm nearly there it's just the vague error message that had me stumped :)
>
> On 9 Oct 2010, at 04:18, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
>> If you only need authentication you may want to consider using rpx as
>> shown in this video:
>>
>> http://vimeo.com/13485916
>>
>> On Oct 8, 7:36 pm, Carl <carl.ro...@gmail.com> wrote:
>>> I've been following the instructions 
>>> athttp://code.google.com/p/python-linkedin/
>>> to add linkedin authentication. I grabbed the latest revision (#20)
>>> from svn.
>>>
>>> I've started by creating a new app (and called it oauth) within web2py
>>> to keep things simple.
>>>
>>> Into default.py I've added the following functions (and I've defined
>>> my own KEY and SECRET in db.py). When I 
>>> enterhttp://127.0.0.1:8000/oauth/default/linkedin
>>> I am redirected to the LinkedIn website where I can give permission to
>>> log in. Once I do that I am redirected 
>>> tohttp://127.0.0.1:8000/oauth/default/profile/
>>> Here I can retrieve request.vars.oauth_verifier for a call to
>>> api.accessToken(). however, the return value is False and a call to
>>> api.getRequestTokenError() returns "permission_unknown". I can't find
>>> out what is causing this error.
>>>
>>> Any ideas?
>>>
>>> def linkedin():
>>>   RETURN_URL = "http://127.0.0.1:8000/oauth/default/profile/";
>>>   import gluon.contrib.login_methods.linkedin
>>>   from gluon.contrib.login_methods.linkedin import LinkedIn
>>>   api = LinkedIn(KEY, SECRET, RETURN_URL)
>>>   token = api.requestToken()
>>>   if not api.getRequestTokenError():
>>>       u = api.getAuthorizeURL(request_token=api.request_token)
>>>       redirect(u)
>>>   return dict(message=T('Hello World'),token=token,
>>> request_token=api.request_token,
>>> token_secret=api.request_token_secret)
>>>
>>> def profile():
>>>     oauth_token = request.vars.oauth_token
>>>     oauth_verifier = request.vars.oauth_verifier
>>>
>>>     RETURN_URL = "http://127.0.0.1:8000/oauth/default/more/";
>>>     import gluon.contrib.login_methods.linkedin
>>>     from gluon.contrib.login_methods.linkedin import LinkedIn
>>>     api = LinkedIn(KEY, SECRET, RETURN_URL)
>>>     token = api.requestToken()
>>>     result = api.accessToken(verifier=oauth_verifier)
>>>     profile = None
>>>     if result:
>>>         profile = api.GetProfile(url='http://www.linkedin.com/in/
>>> carlroach')
>>>     else:
>>>         print api.getRequestTokenError()
>>>
>>>     return dict(message=T('Profile info'), profile=profile)
>>>
>>> def more():
>>>     return dict(message='more')
>

Reply via email to