TIL - 29 : Kakao OAuth 2.0 Login

TIL - 29 : Kakao OAuth 2.0 Login

Kakao OAuth 2.0 Login


  • OAuth2.0 의 작동방식
    • 구글, 페이스북, 카카오, 네이버가 이것을 쓰고있음
    • 4가지 방식 존재
      • Authorization Code Grant
      • Implicit Grant
      • Resource Owner Password Credentials Grant
      • Client Credentials Grant
  • Rest API 와 Redirect URL 의 개념
    • https://kauth.kakao.com/oauth/authorize?client_id=${CLIENT_ID}& redirect_uri=${REDIRECT_URI}&response_type=code
  • 코드를 가져올때 쓴 방법
    • const accessCode = new URLSearchParams(location.search).get('code');
  • .env 개념
    • 환경변수, 항상 REACT_APP_ 으로 시작
    • 동작하지 않을시 env 라이브러리 설치
  • 비동기 데이터 통신으로 Access Code 받고 백엔드 전송

© 2022.02 by sunnyfterrain