Skip to content

구글 로그인

alia edited this page Dec 21, 2020 · 8 revisions

구글 로그인

메소드 경로 짧은 설명
POST /login/google 구글 로그인

요청 헤더

Content-Type: application/json

요청 바디

{
    "idToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImRlZGMwMTJkMDdmNTJhZWRmZDVmOTc3ODRlMWJjYmUyM2MxOTcyNGQiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiI3MzYyNTUwNTAzMjQtYzV0NTZzMHQwMjJwaG9tNzM2OG1nOXNzZWJvamZpY2MuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiI3MzYyNTUwNTAzMjQtYzV0NTZzMHQwMjJwaG9tNzM2OG1nOXNzZWJvamZpY2MuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMDk4NjkzMDM0ODgwNzMyNDc4NTQiLCJlbWFpbCI6Inllc2ZvcmRldkBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiYXRfaGFzaCI6IjhwOFZvVjFDbGR2anJMY1l1blpwbkEiLCJuYW1lIjoiWW91bmdldW4gU2VvIiwicGljdHVyZSI6Imh0dHBzOi8vbGg2Lmdvb2dsZXVzZXJjb250ZW50LmNvbS8tNThBM1RLdFR0RmcvQUFBQUFBQUFBQUkvQUFBQUFBQUFBQUEvQU1adXVjblZXU3hXV2dNSGdIRkM4YXEydmktRC0ySWx2dy9zOTYtYy9waG90by5qcGciLCJnaXZlbl9uYW1lIjoiWW91bmdldW4iLCJmYW1pbHlfbmFtZSI6IlNlbyIsImxvY2FsZSI6ImtvIiwiaWF0IjoxNjA2MTEyOTA2LCJleHAiOjE2MDYxMTY1MDZ9.U3_x3v9L6omLxNHAXaV8esN9dMy6SbDr3UFYVdiTAG2p_bzg3nenYoPMrwU8s1AL--z9DcXk_YKLJJE8ad5A5i-Q6K7FsDCCfhRZk3158rKj8_yCahvMXLJnpG45Au1JE82F76GmS4yYiamu33rRXS3kyQkS1Bg25B0GTphQCDOvc_B2fHTd038v5YSecrFjwk34AIaP4EyD9vnrM2_r6Jl7AGatPxN8orc1x4nrpBwT1rs71FIdg4pdA9VLVrjn6bgkFiHja7951-nUNoB0YZ50LgLyhrY0oF5FzofwDxeUVMaDehglqUnspEQVvkdJfCXf23uTHBkol7wjKloc4Q",
    "fcmToken":"zd12kwrendfkgshth:ewserrgf12gvjgytrdxfcbvgt-_-weretsxcfgh9esr58ytreewsdfvnbh1fgh345twert98qwregfhg4jbhvgf123nbgghj"
}

응답 바디

로그인 성공 (이미 존재하는 회원일 경우 로그인)

{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJUT1NUIiwidXNlcklkeCI6NCwiZXhwIjoxNjEyMzIyMjc0fQ.mMJKz1DXfelW898MG7JxMV0g3uuT7V9Ippg2vVk_j-4",
    "isFirstTime": false
}
  • Status Code: 200 OK
  • 토큰 유효기간: 발급일로부터 2달

#### 로그인 성공 (처음 로그인 한 경우)
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJUT1NUIiwidXNlcklkeCI6NCwiZXhwIjoxNjEyMzIyMjc0fQ.mMJKz1DXfelW898MG7JxMV0g3uuT7V9Ippg2vVk_j-4",
    "isFirstTime": true
}
  • Status Code: 200 OK
  • 토큰 유효기간: 발급일로부터 2달

idToken이 존재하지 않을 때

{
    "timestamp": "2020-12-02T09:09:12.306+00:00",
    "status": 400,
    "error": "Bad Request",
    "message": "",
    "path": "/login/google"
}
  • Status Code: 400 Bad Request

idToken이 잘못된 값일 때

return 없음

  • Status Code: 200 Ok

INTERNAL SERVER ERROR

  • Status Code: 500 Internal Server Error