1. 认证授权管理
1.1. 用户名口令认证
Type: POST
Author: xezzon
Content-Type: application/json
Description: 用户名口令认证
Body-parameters:
Parameter | Type | Description | Required | Since |
---|---|---|---|---|
username |
string |
用户名 |
false |
- |
password |
string |
口令 |
false |
- |
Request-example:
curl -X POST -H "Content-Type: application/json" -i 'http://127.0.0.1/auth/login/basic' --data '{
"username": "",
"password": ""
}'
Response-fields:
Field | Type | Description | Since |
---|---|---|---|
tokenName |
string |
token 名称 |
- |
tokenValue |
string |
token 值 |
- |
isLogin |
boolean |
此 token 是否已经登录 |
- |
loginId |
object |
此 token 对应的 LoginId,未登录时为 null |
- |
loginType |
string |
多账号体系下的账号类型 |
- |
tokenTimeout |
int64 |
token 剩余有效期(单位: 秒) |
- |
sessionTimeout |
int64 |
Account-Session 剩余有效时间(单位: 秒) |
- |
tokenSessionTimeout |
int64 |
Token-Session 剩余有效时间(单位: 秒) |
- |
tokenActiveTimeout |
int64 |
token 距离被冻结还剩多少时间(单位: 秒) |
- |
loginDevice |
string |
登录设备类型 |
- |
tag |
string |
自定义数据(暂无意义,留作扩展) |
- |
Response-example:
{
"tokenName": "",
"tokenValue": "",
"isLogin": true,
"loginId": {
"object": "any object"
},
"loginType": "",
"tokenTimeout": 0,
"sessionTimeout": 0,
"tokenSessionTimeout": 0,
"tokenActiveTimeout": 0,
"loginDevice": "",
"tag": ""
}
1.2. 单点登录
Type: GET
Author: xezzon
Content-Type: application/x-www-form-urlencoded
Description: 单点登录
Request-example:
curl -X GET -i 'http://127.0.0.1/auth/sso'
Response-fields:
Field | Type | Description | Since |
---|---|---|---|
tokenName |
string |
token 名称 |
- |
tokenValue |
string |
token 值 |
- |
isLogin |
boolean |
此 token 是否已经登录 |
- |
loginId |
object |
此 token 对应的 LoginId,未登录时为 null |
- |
loginType |
string |
多账号体系下的账号类型 |
- |
tokenTimeout |
int64 |
token 剩余有效期(单位: 秒) |
- |
sessionTimeout |
int64 |
Account-Session 剩余有效时间(单位: 秒) |
- |
tokenSessionTimeout |
int64 |
Token-Session 剩余有效时间(单位: 秒) |
- |
tokenActiveTimeout |
int64 |
token 距离被冻结还剩多少时间(单位: 秒) |
- |
loginDevice |
string |
登录设备类型 |
- |
tag |
string |
自定义数据(暂无意义,留作扩展) |
- |
Response-example:
{
"tokenName": "",
"tokenValue": "",
"isLogin": true,
"loginId": {
"object": "any object"
},
"loginType": "",
"tokenTimeout": 0,
"sessionTimeout": 0,
"tokenSessionTimeout": 0,
"tokenActiveTimeout": 0,
"loginDevice": "",
"tag": ""
}