Skip to content

Commit

Permalink
fix for linkedin issue
Browse files Browse the repository at this point in the history
Fixed an issue with OAuth1 not working correctly with LinkedinBackend
  • Loading branch information
adambratt committed Aug 22, 2013
1 parent 9a79d9f commit 12d56ca
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion social_auth/backends/contrib/linkedin.py
Expand Up @@ -56,8 +56,17 @@ def get_user_details(self, response):
'last_name': last_name,
'email': email}

@classmethod
def tokens(cls, instance):
""" Return list of OAuth v1 tokens from Linkedin """
token = super(LinkedinBackend, cls).tokens(instance)
if token and 'access_token' in token:
token = dict(tok.split('=')
for tok in token['access_token'].split('&'))
return token

class LinkedinOAuth2Backend(LinkedinBackend):

class LinkedinOAuth2Backend(OAuthBackend):
"""Linkedin OAuth2 authentication backend"""
name = 'linkedin-oauth2'

Expand Down

0 comments on commit 12d56ca

Please sign in to comment.