https://cic_irc.yuque.com/tyl581/ggwv9w/elucozu6sgklyr7g
二方包坐标
<dependency>
<groupId>com.aliyun.fsi.insurance</groupId>
<artifactId>aboss-sso-client</artifactId>
<version>1.3.4-RELEASE</version>
</dependency>
账密登录
METHOD: com.aliyun.fsi.insurance.sso.api.LoginFacade
ResultModel<LoginTokenDTO> loginByPassword(PasswordLoginCmd passwordLoginCmd);
Body-parameters:
| Parameter | Type | Description | Required | Since |
| username | string | 用户名 | true | - |
| password | string | 密码 | true | - |
| appId | string | appId | true | - |
Request-example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i /platform/api/aboss/sso/login-by-password --data '{
"username": "sanford.murazik",
"password": "sxeap7",
"appId": "81"
}'
Response-example:
{
"status": 1,
"message": null,
"data": {
"key": "cic-htoken",
"value": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMGNjNzA2MTMxN2I5YzNmMjE5OThjZWVhYzQ2MDkwNlVvSHhFR1N5VFozIiwiYXBwSWQiOiJiMGNjNzA2MTMxN2I5YzNmMjE5OThjZWVhYzQ2MDkwNlVvSHhFR1N5VFozIiwiYWNjZXNzVG9rZW4iOiJleUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKaGRXUWlPbHNpWlc1MFpYSndjbWx6WlY5dGIySnBiR1ZmY21WemIzVnlZMlVpTENKaVptWmZZWEJwWDNKbGMyOTFjbU5sSWwwc0ltVjRjQ0k2TVRZMk5UY3dORE16T1N3aWRYTmxjbDl1WVcxbElqb2lNVEF4TURBd01USXpNeUlzSW1wMGFTSTZJalF6TVRVeE5HVXlMVGc1TXpJdE5HRTFZUzA0TURZMUxUZGtPRE16TmpKbE5tVTRNU0lzSW1Oc2FXVnVkRjlwWkNJNkltSXdZMk0zTURZeE16RTNZamxqTTJZeU1UazVPR05sWldGak5EWXdPVEEyVlc5SWVFVkhVM2xVV2pNaUxDSnpZMjl3WlNJNld5SnlaV0ZrSWwxOS5leWRHdWtRd185dWdWOUpOX0ttVzZ2YjBPYkR4RTA1WHN3MXJ4anpyM0pVIiwiZXhwIjoxNjY1NzA0MzM5LCJpYXQiOjE2NjU2NjExMzksImp0aSI6IjMyYzgwODUxLWQwOGItNGY1Yi1iZjk3LTNhZDBjYTRhMTczZCJ9.n7R_XPbyoDTqx_SkzSKSNOaW6u1-psWR5sz9_1gVrH0",
"expires": 43200
},
"needRetry": false,
"extendInfo": null,
"pageSize": 0,
"totalCount": null,
"pageIndex": 0,
"digetValues": [],
"digestLog": "-"
}
登录成功后写cookie(key:cic-ctoken),同时返回token信息,字段名如下
| 字段名 | 含义 | 是否必填 | 备注 |
| key | token对应key | 是 | 鉴权时放到header中的key值 |
| value | token对应value | 是 | 鉴权时放到header中的value值 |
| expires | token过期时间 | 是 | token过期时间(s) |
退出登录
METHOD: com.aliyun.fsi.insurance.sso.api.LoginFacade
ResultModel<Void> logout(UserInfoQry userInfoQry);
Body-parameters:
| Parameter | Type | Description | Required | Since |
| token | string | 登录token | true | - |
Request-example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i /platform/api/aboss/sso/log-out --data '{
"token": "lef1oq"
}'
Response-example:
{
"status": 1,
"message": null,
"data": null,
"needRetry": false,
"extendInfo": null,
"pageSize": 0,
"totalCount": null,
"pageIndex": 0,
"digetValues": [],
"digestLog": "-"
}
获取登录账号信息
METHOD**:** com.aliyun.fsi.insurance.sso.api.LoginFacade#userInfo(com.aliyun.fsi.insurance.sso.dto.UserInfoQry)
Body-parameters:
| Parameter | Type | Description | Required | Since |
| token | string | 登录token | true | - |
Request-example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i /platform/api/aboss/sso/user-info --data '{
"token": "wmkise"
}'
Response-example:
{
"status": 1,
"message": null,
"data": {
"accType": "73fh1y",
"accId": "1",
"username": "emmitt.bashirian",
"personNo": "vf1qhs",
"personName": "emmitt.bashirian"
},
"needRetry": false,
"extendInfo": null,
"pageSize": 0,
"totalCount": null,
"pageIndex": 0,
"digetValues": [],
"digestLog": "-"
}
外部登录接口
oauth2登录
URL: /platform/api/aboss/sso/external/oauth2-login
Type: POST
Author: ZH
Content-Type: application/json; charset=utf-8
Description: oauth2登录
com.aliyun.fsi.insurance.sso.api.ExternalLoginFacade#oauth2Login
Body-parameters:
| Parameter | Type | Description | Required | Since |
| appId | string | 登录appId | true | - |
| loginCode | string | oauth2登录code | true | - |
Request-example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i /platform/api/aboss/sso/external/oauth2-login --data '{
"appId": "40",
"loginCode": "45623"
}'
Response-fields:
| Field | Type | Description | Since |
| key | string | 登录成功返回的token键 | - |
| value | string | 登录成功返回的token值 | - |
| expires | int64 | token超时时间(秒) | - |
| accessToken | string | 登录成功返回的token值 | 废弃 |
Response-example:
{
"key": "nkp25j",
"value": "badbo2",
"expires": 591,
"accessToken": "jwf2bq"
}
根据token查询用户信息
URL: /platform/api/aboss/sso/external/userinfo
Type: POST
Author: ZH
Content-Type: application/json; charset=utf-8
Description: oauth2登录
com.aliyun.fsi.insurance.sso.api.ExternalLoginFacade#userInfo
Body-parameters:
| Parameter | Type | Description | Required | Since |
| loginToken | string | 登录token | true | - |
Request-example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i /platform/api/aboss/sso/external/userinfo --data '{
"loginToken": "0kzswq"
}'
Response-fields:
| Field | Type | Description | Since |
| accRole | string | 账户角色(1-普通用户,2-超管) | - |
| accType | string | 账户类型(0-内部,1-外部) | - |
| accId | string | 账户Id | - |
| username | string | 账户名称(登录账户名) | - |
| personNo | string | 员工编号 | - |
| personName | string | 人员名称 | - |
| sub | string | 账户Id | - |
| channelType | string | 渠道来源 idaas | - |
| permissionCode | string | 授权码 | - |
Response-example:
{
"accRole": "kesg41",
"accType": "lzbps8",
"accId": "40",
"username": "livia.koss",
"personNo": "nw1hay",
"personName": "livia.koss",
"sub": "oxj4h8",
"channelType": "hsbccj",
"permissionCode": "45623"
}