授權認證

處理使用者身份的驗證及授權,包括:取得 access token、更新 access token。

登入

post
Body
accountstringRequired
passwordstringRequired
Responses
200

登入成功

{
  code: 200,
  data: {
    USER_ID: number,
    REFRESH_TOKEN: string,
    ACCESS_TOKEN: string,
  },
}

No content

post
POST /api/auth/signIn HTTP/1.1
Host: 104demotest-api-server.hrmax.104.com.tw
Content-Type: application/json
Accept: */*
Content-Length: 47

{
  "USER_ACCOUNT": "*******",
  "USER_PWD": "*******"
}

No content

登出

post
Authorizations
Body
REFRESH_TOKENstringRequired

refresh token

Responses
200

成功登出

No content

post
POST /api/auth/signOut HTTP/1.1
Host: 104demotest-api-server.hrmax.104.com.tw
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 257

"{\n  \"REFRESH_TOKEN\": \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJiaWQiOjU5LCJ1c2VySWQiOjg0MywiaXNBZG1pbiI6ZmFsc2UsImlhdCI6MTY1Mjc3MTcyNCwiZXhwIjoxNjg0MzI5MzI0fQ.IeZ-PI24dUXGgA3W97yQ05J863spZ7GmBSI2HQ5FUJ0a-h9Smi3wmxHtT0FqUWUjmM-qJtDucpUwQBdIaW5olQ\"\n}\n"

No content

更新access token

post
Body
REFRESH_TOKENstringRequired

refresh token

Responses
200

更新成功

{
  code: 200,
  access: string, // 新的 access token
}

No content

post
POST /api/auth/token/refresh HTTP/1.1
Host: 104demotest-api-server.hrmax.104.com.tw
Content-Type: application/json
Accept: */*
Content-Length: 257

"{\n  \"REFRESH_TOKEN\": \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJiaWQiOjU5LCJ1c2VySWQiOjg0MywiaXNBZG1pbiI6ZmFsc2UsImlhdCI6MTY1Mjc3MTcyNCwiZXhwIjoxNjg0MzI5MzI0fQ.IeZ-PI24dUXGgA3W97yQ05J863spZ7GmBSI2HQ5FUJ0a-h9Smi3wmxHtT0FqUWUjmM-qJtDucpUwQBdIaW5olQ\"\n}\n"

No content