Search

Auth (Login)

1. Kakao( 차후 Kakao Sync Login)

ID 284073 네이티브 앱 키    6a3910662cb4fdb592a81d321e65269f REST API 키      b064772e83525bebdef98756e5d1cb02 JavaScript 키    845bcc44fe03d9729f09b218a24a0ebe Admin 키 897a81f8dd66986e7c19fb68f4b4ae6b

auth req/res value

POST /v1/user/unlink
Authorization: Bearer access_token
Content-Type: aplication/x-www-form-urlencoded
{ "id": 1592018545 }
Plain Text
복사
POST /v1/user/logout
Authorization: Bearer access_token
{ "id": 1592018545 }
Plain Text
복사
GET /v1/user/access_token_info
Authorization: Bearer access_token
{ "id": 1592018545, "expiresInMillis": 21454463, "expires_in": 21454, "app_id": 10395, "appId": 10395 }
Plain Text
복사
POST /v1/user/update_profile
Authorization: Bearer access_token
Content-Type: aplication/x-www-form-urlencoded
{ "id": 1592018545 }
Plain Text
복사
GET /v2/user/me
Authorization: Bearer access_token
{ "id": 1592018545, "connected_at": "2021-01-11T11:26:26Z", "properties": { "nickname": "ㄱ양억", "profile_image": "<http://k.kakaocdn.net/dn/c4TSlc/btqKBOg1sbK/2RD60ZVxyINiu79uJGoVnk/img_640x640.jpg>", "thumbnail_image": "<http://k.kakaocdn.net/dn/c4TSlc/btqKBOg1sbK/2RD60ZVxyINiu79uJGoVnk/img_110x110.jpg>" }, "kakao_account": { "profile_needs_agreement": false, "profile": { "nickname": "ㄱ양억", "thumbnail_image_url": "<http://k.kakaocdn.net/dn/c4TSlc/btqKBOg1sbK/2RD60ZVxyINiu79uJGoVnk/img_110x110.jpg>", "profile_image_url": "<http://k.kakaocdn.net/dn/c4TSlc/btqKBOg1sbK/2RD60ZVxyINiu79uJGoVnk/img_640x640.jpg>" }, "has_email": true, "email_needs_agreement": false, "is_email_valid": true, "is_email_verified": true, "email": "wooky92@naver.com", "has_age_range": true, "age_range_needs_agreement": false, "age_range": "30~39", "has_birthday": true, "birthday_needs_agreement": false, "birthday": "0601", "birthday_type": "SOLAR", "has_gender": true, "gender_needs_agreement": false, "gender": "male" } }
Plain Text
복사

2. Firebase Login (for email)

프로젝트 이름 Signal 프로젝트 ID signal-97eaf 프로젝트 번호 493631048995 기본 GCP 리소스 위치 nam5 (us-central) 웹 API 키 AIzaSyCo8MlwzJ_FMuWCbhhhaHpaGluLfX7hTak 앱 ID 1:493631048995:web:5a51cbfc53a696cb const firebaseConfig = { apiKey: "AIzaSyCo8MlwzJ_FMuWCbhhhaHpaGluLfX7hTak", authDomain: "signal-97eaf.firebaseapp.com", databaseURL: "https://signal-97eaf.firebaseio.com", projectId: "signal-97eaf", storageBucket: "signal-97eaf.appspot.com", messagingSenderId: "493631048995", appId: "1:493631048995:web:5a51cbfc53a696cb" };

3. firebase customToken

1.
front에서 kakao login을 하고 시그널 서버로 accessToken(kakaoToken)을 보낸다.
2.
시그널 서버에서 kakaoToken validate 한다.
3.
2번을 통과 하면 firebase createCustomToken 을 하고 결과 값(firebaseTonken)을 front로 내려준다. https://firebase.google.com/docs/auth/admin/create-custom-tokens
4.
이후 front는 firebase signInWithCustomToken 를 통해서 token login 한다. https://firebase.google.com/docs/auth/web/custom-auth?hl=ko
5.
이후 front는 firebase onAuthStateChanged 를 통해서 인증을 관리 한다.
6.
unlink redirect_url을 통해서 hooking이 되면 firebase unlink 를 해서 탈퇴 해준다. https://firebase.google.com/docs/auth/web/account-linking?hl=ko
7.
중요 : 회원가입의 경우에 어떻게 할지는 아직 검토 하지 않았음.. 위에 내용은 only login scenario...