主题
兼容E+接口
接口名称 | 接口路径 | 说明 | E+接口 |
---|---|---|---|
获取accessToken接口 | /api/sso/oauth2/token/getAccessToken | 根据appId secret 获取token | https://ejia.tbea.com/gateway/oauth2/token/getAccessToken |
刷新accessToken接口 | /api/sso/oauth2/token/refreshToken | 根据appId refreshToken 获取token | https://ejia.tbea.com/gateway/oauth2/token/refreshToken |
根据ticket解析用户身份 | /api/sso/ticket/user/acquirecontext | 根据ticket解析用户身份 | https://ejia.tbea.com/gateway/ticket/user/acquirecontext?accessToken=xxxxxx |
获取accessToken接口
接口名称 | url | 请求方式 | Content-Type |
---|---|---|---|
请求用户授权Token | /api/sso/oauth2/token/getAccessToken | post | application/json |
请求参数
参数名称 | 参数说明 | 是否必填 | 数据类型 |
---|---|---|---|
appId | 应用appId | 是 | string |
secret | 应用secret | 是 | string |
timestamp | 当前北京时间,Unix格式13位时间戳,精确到毫秒,3分钟内有效。 | 是 | long |
scope | 授权级别 | 是 | String |
返回值
json
{
"code": 200,
"message": null,
"data": {
"ticket": "1122972954242580481",
"type": "Bearer",
"token": "xxxxxxx",
"remeberMe": null,
"jobNo": null,
"userType": null,
"id": "app_xxxxxxx",
"name": "app_xxxxxxx",
"username": "app_xxxxxxx",
"displayName": null,
"email": null,
"instId": null,
"instName": null,
"passwordLastSetTime": null,
"passwordSetType": 0,
"authorities": [
"ROLE_APP"
],
"refresh_token": "xxxxxxx",
"expired": 1296000
}
}
请求示例
curl
curl --location --request POST 'url/api/sso/oauth2/token/getAccessToken' \
--header 'Content-Type: application/json' \
--data-raw ' {
"appId": "xxx",
"secret": "xxxx",
"timestamp": "1747102707279",
"scope": "app"
}'
刷新accessToken接口
接口名称 | url | 请求方式 | Content-Type |
---|---|---|---|
刷新accessToken接口 | /api/sso/oauth2/token/refreshToken | post | application/json |
请求参数
参数名称 | 参数说明 | 是否必填 | 数据类型 |
---|---|---|---|
appId | 应用appId | 是 | string |
refreshToken | token刷新令牌,由获取accessToken接口得到的refreshToken | 是 | string |
timestamp | 当前北京时间,Unix格式13位时间戳,精确到毫秒,3分钟内有效。 | 是 | long |
scope | 授权级别 | 是 | String |
返回值
json
{
"code": 200,
"message": null,
"data": {
"ticket": "1122972954242580481",
"type": "Bearer",
"token": "xxxxxxx",
"remeberMe": null,
"jobNo": null,
"userType": null,
"id": "app_xxxxxxx",
"name": "app_xxxxxxx",
"username": "app_xxxxxxx",
"displayName": null,
"email": null,
"instId": null,
"instName": null,
"passwordLastSetTime": null,
"passwordSetType": 0,
"authorities": [
"ROLE_APP"
],
"refresh_token": "xxxxxxx",
"expired": 1296000
}
}
请求示例
curl
curl --location --request POST 'url/api/sso/oauth2/token/refreshToken' \
--data-raw ' {
"appid": "xxx",
"refreshToken": "xxx",
"timestamp": "1747102769283",
"scope": "app"
}'
根据ticket解析用户身份
接口名称 | url | 请求方式 | Content-Type |
---|---|---|---|
获取用户身份 | /api/sso/ticket/user/acquirecontext?accessToken=xxxxxx | post | application/json |
请求参数
参数名称 | 参数说明 | 是否必填 | 数据类型 |
---|---|---|---|
appid | 应用appId(client_id) | 是 | string |
ticket | 认证总地址接口根据应用数据拼装成的地址中有ticket参数,ticket时效为很短,不建议开发者缓存使用 | 是 | string |
返回值
json
{
"data": {
"appid": null,
"eid": null,
"openid": null,
"username": "系统管理员",
"uid": null,
"tid": null,
"userid": null,
"oid": null,
"networkid": null,
"xtid": null,
"ticket": null,
"deviceId": null,
"jobNo": "admin",
"email": "",
"orgId": null,
"mobile": "",
"photoUrl": null,
"department": "",
"longName": null,
"departOrgName": null,
"isAdmin": null,
"account": "admin",
"projectCode": null
},
"success": true,
"errorCode": 0,
"error": null
}
请求示例
curl
curl --location --request POST 'url/api/sso/ticket/user/acquirecontext?accessToken=xxxxxx' \
--data-raw ' {
"appid": "xxx",
"ticket": "xxx"
}'