Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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],
}