카카오2 카카오 로그인 (FrontEnd) 카카오 개발자 docs에 있는 내용이다. var access_token = localStorage.getItem('access_token'); // 카카오 로그인 ############################################### function loginWithKakao() { access_token || Kakao.Auth.authorize({ redirectUri: `${frontend_base_url}/temp.html`, }); } 리소스는 카카오 개발자 docs에 있으므로 그곳에서 다운 받아 사용하면 될 것이다. django 2023. 6. 17. 카카오 로그인 (BackEnd) 1. 프론트에서 카카오톡에 연결해 코드를 받는다. 2. 프론트에서 준 코드로 카카오톡의 token을 받는다. def get(self, request): code = request.GET.get('code') kakao_token_api = 'https://kauth.kakao.com/oauth/token' data = { 'grant_type' : 'authorization_code', 'client_id' : KAKAO_REST_API_KEY, 'redirection_url' : KAKAO_REDIRECT_URL, 'code' : code, 'client_secret' : KAKAO_SECRET_KEY, } headers = {'Content-type': 'application/x-www-form-ur.. django 2023. 6. 15. 이전 1 다음