Authentication

Login

Endpoint

POST /auth/login

Headers

Key
Value
Description

Authorization

{token}

JWT access token

App-Id

{app_id}

Unique identifier for the application

Request Body

{
  "userId": "string",
  "nickname": "string",
  "profileImageUrl": "string"
}

Response

{
  "status": 200,
  "message": "success",
  "userId": "string",
  "expiresAt": "date"
}

JWT Access Token

Access Token Payload

{
  "sub": "user123",  // ์‚ฌ์šฉ์ž ๊ณ ์œ  ID
  "app_id": "rakuraku3",  // ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ID
  "iat": 1705080000,  // ๋ฐœ๊ธ‰ ์‹œ๊ฐ„ (Issued At, Unix timestamp)
  "exp": 1705086400  // ๋งŒ๋ฃŒ ์‹œ๊ฐ„ (Expiration, Unix timestamp)
}

Key

Type

์„ค๋ช…

sub

string

์‚ฌ์šฉ์ž ๊ณ ์œ  ID

iat

int

ํ† ํฐ ๋ฐœ๊ธ‰ ์‹œ๊ฐ„ (Unix timestamp)

exp

int

ํ† ํฐ ๋งŒ๋ฃŒ ์‹œ๊ฐ„ (Unix timestamp)


JWT ์•Œ๊ณ ๋ฆฌ์ฆ˜

  • ์•Œ๊ณ ๋ฆฌ์ฆ˜: HS256 (HMAC-SHA256)

  • Signature ์ƒ์„ฑ ๋ฐฉ์‹:

    HMACSHA256(
      base64UrlEncode(header) + "." + base64UrlEncode(payload), 
      secretKey
    )

Last updated