Skip to content

Commit

Permalink
Merge pull request #539 from dobestan/feature/kakao-oauth2
Browse files Browse the repository at this point in the history
fix issue #538 : disable redirect_state on KakaoOAuth2
  • Loading branch information
omab committed Mar 5, 2015
2 parents 1d55aab + 26cd455 commit 8d5cb6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/django_example/example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
'social.backends.google.GoogleOpenIdConnect',
'social.backends.instagram.InstagramOAuth2',
'social.backends.jawbone.JawboneOAuth2',
'social.backends.kakao.KakaoOAuth2',
'social.backends.linkedin.LinkedinOAuth',
'social.backends.linkedin.LinkedinOAuth2',
'social.backends.live.LiveOAuth2',
Expand Down
8 changes: 8 additions & 0 deletions social/backends/kakao.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class KakaoOAuth2(BaseOAuth2):
AUTHORIZATION_URL = 'https://kauth.kakao.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://kauth.kakao.com/oauth/token'
ACCESS_TOKEN_METHOD = 'POST'
REDIRECT_STATE = False

def get_user_id(self, details, response):
return response['id']
Expand All @@ -30,3 +31,10 @@ def user_data(self, access_token, *args, **kwargs):
"""Loads user data from service"""
return self.get_json('https://kapi.kakao.com/v1/user/me',
params={'access_token': access_token})

def auth_complete_params(self, state=None):
return {
'grant_type': 'authorization_code',
'code': self.data.get('code', ''),
'client_id': self.get_key_and_secret()[0],
}

0 comments on commit 8d5cb6f

Please sign in to comment.