로그인을 성공적으로 끝내고, 네이버 코드
을 가져왔다. Joinc 사이트는 이 코드를 이용해서 네이버 회원 서버에 access token과 refresh token을 가져올 수 있다. 아래 버튼을 클릭해 보자.
Get Access Token & Access Token
Access token과 refresh token을 확인 할 수 있을 것이다. 여기에 사용한 코드는 아래와 같다.
이제 Access token을 이용해서 네이버 OpenAPI를 호출 할 수 있다. 가장 간단한 유저정보 가져오는 코드를 만들어보자.
유저 정보 가져오기
이렇게 joinc 서비스는 네이버로 로그인한 유저를 인증했다. 이제 로그인한 유저의 정보를 읽은 다음 joinc의 회원 테이블에 저장하고 세션을 발급하면 네이버 로그인 연동이 끝난다. 유저 정보(프로파일)은 access token으로 요청한다. 요청 API 주소는 https://openapi.naver.com/v1/nid/me 다.
Contents
네이버 Callback URL 테스트
Access token을 이용한 OpenAPI 호출
유저 정보 가져오기
Recent Posts
Archive Posts
Tags