授權認證
處理使用者身份的驗證及授權,包括:取得 access token、更新 access token。
Body
accountstringRequired
passwordstringRequired
Responses
200
登入成功
{
code: 200,
data: {
USER_ID: number,
REFRESH_TOKEN: string,
ACCESS_TOKEN: string,
},
}
No content
440
參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)
490
登入失敗
{
code: 490,
msg: string, // 失敗原因
}
500
系統異常 { code: 500, msg: string }
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
Authorizations
Body
REFRESH_TOKENstringRequired
refresh token
Responses
200
成功登出
No content
401
認證失敗 (請更新 accessToken 再試一次)
440
參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)
500
系統異常 { code: 500, msg: string }
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
Body
REFRESH_TOKENstringRequired
refresh token
Responses
200
更新成功
{
code: 200,
access: string, // 新的 access token
}
No content
440
參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)
490
驗證失敗 { code: 490, msg: string }
500
系統異常 { code: 500, msg: string }
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