-
Notifications
You must be signed in to change notification settings - Fork 0
应用后端接入(RefreshToken)
Mmx edited this page May 17, 2024
·
15 revisions
仍然需要前端传来的 token
,
POST https://v.ncuos.com/api/v1/public/login/verify
Form:
key | type | required | desc |
---|---|---|---|
token | string | √ | |
grantType | string | √ | 授权类型,当前模式固定为 refresh_token
|
clientIp | string | x | 客户端 ip |
valid | int64 | x | RefreshToken 有效时长,秒,默认最小值,7-30 天 |
payload | string | x | 自定义 payload,长度小于 32 |
成功:
{
"code": 0,
"data": {
"id": 8,
"name": "孙翔宇",
"avatarUrl": "https://aaa.bbb.com/ccc.png", // 固定为飞书头像
"groups": [
"研发",
"中心"
],
"refreshToken": "xxxx",
"accessToken": "xxxx"
}
}
失败:
{
"code": 5,
"msg": "身份校验失败,权限不足"
}
PATCH https://v.ncuos.com/api/v1/app/token/refresh/
Form:
key | type | required | desc |
---|---|---|---|
token | string | √ | RefreshToken |
payload | string | √ | |
accessToken | boolean | x | 是否同时签发 AccessToken |
成功:
{
"code": 0,
"data": {
"refreshToken": "xxxx",
"accessToken": "xxxx" // 是否存在取决于表单
}
}
DELETE https://v.ncuos.com/api/v1/app/token/refresh/
Form:
key | type | required | desc |
---|---|---|---|
token | string | √ | RefreshToken |
成功:
{
"code": 0
}
失败:
{
"code": 5, // token 无效或过期对应 code 31,其他情况为调用端错误或 GeniusAuth 异常
"msg": "身份校验失败,权限不足"
}
POST https://v.ncuos.com/api/v1/app/token/refresh/
Form:
key | type | required | desc |
---|---|---|---|
token | string | √ | RefreshToken |
成功:
{
"code": 0,
"data": {
"uid": 8
"payload": "example"
}
}
失败:
{
"code": 5, // token 无效或过期对应 code 31,其他情况为调用端错误或 GeniusAuth 异常
"msg": "身份校验失败,权限不足"
}
POST https://v.ncuos.com/api/v1/app/token/access/verify
Form:
key | type | required | desc |
---|---|---|---|
token | string | √ | AccessToken |
成功:
{
"code": 0,
"data": {
"uid": 8
"payload": "example"
}
}
失败:
{
"code": 5, // token 无效或过期对应 code 31,其他情况为调用端错误或 GeniusAuth 异常
"msg": "身份校验失败,权限不足"
}
POST https://v.ncuos.com/api/v1/app/token/access/user/info
Form:
key | type | required | desc |
---|---|---|---|
token | string | √ | AccessToken |
成功:
{
"code": 0,
"data": {
"userID": 8,
"name": "孙翔宇",
"avatarUrl": "https://aaa.bbb.com/ccc.png",
"groups": [
"研发",
"中心"
],
}
}