auth
帐密认证
- 请求路由:
auth- 交互模型:
Request Response- 访问限制: 无
使用帐户名和密码进行登录认证,正常认证后返回token。
请求
RSocket.rr({
"route" : "auth",
"data" : {
"username" : "user1@aspiretop",
"password" : "pass",
"scope" : "shop",
"captchaKey" : "2392ba011cbc4e9888f546cbfa20694f",
"captchaCode" : "baayz"
}
});
请求参数
| 名称 | 类型 | 必须 | 说明 |
|---|---|---|---|
username | String | 否 | |
password | String | 否 | |
scope | String | 否 | |
captchaKey | String | 否 | |
captchaCode | String | 否 |
返回
返回认证结果
{
"token" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pb......AU3eAWOfMmNN8CMIlIvkNw",
"expires" : 3600,
"user" : {
"tenantId" : "aspiretop",
"username" : "user1@aspiretop",
"accountId" : "user1",
"domain" : "aspiretop",
"fullname" : "用户1",
"status" : 1,
"userTypes" : [ ]
}
}
返回属性
| 名称 | 类型 | 说明 |
|---|---|---|
token | String | API访问令牌 |
expires | Number | 令牌有效期,单位秒 |