互联身份验证
# 描述
互联身份验证
# 请求说明
请求方式:POST + application/json
请求路径:https://${填入所在云的域名}/er/oauth/getUserInfoByCode?thirdTraceId=${随机字符串}
请求头填写 :参考公共参数填写
# 请求参数
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| grantType | String | 是 | 授权模式,该接口值为:authorization_code |
| appId | String | 是 | 自建应用的appId |
| appSecret | String | 是 | 自建应用的appSecret |
| redirectUrl | String | 是 | 第三方登录地址 |
| code | String | 是 | 登录成功后返回的code(见特殊说明) |
| mapperObjectApiName | String | 否 | AccountObj:关联客户;PartnerObj:关联合作伙伴 |
# 请求示例
{
"mapperObjectApiName": "xxxxx",
"redirectUrl": "xxxxx",
"code": "xxxxx",
"appId": "xxxxx",
"appSecret": "xxxxx",
"grantType": "authorization_code"
}
# 返回参数
| 参数 | 类型 | 说明 |
|---|---|---|
| traceId | string | 请求唯一ID |
| errorDescription | string | 错误描述 |
| errorMessage | string | 错误信息 |
| errorCode | Int | 查看错误码 |
# 返回示例
{
"traceId": "E-O.827xxxxxx",
"errorDescription": "success",
"errorMessage": "OK",
"errorCode": 0
}
# 注意事项
- 不能使用返回值的message字段做逻辑判断,errorMessage会有变化;
# 特殊说明
# 通过已有的互联应用打开第三方系统
在互联应用中嵌入如下地址: https://{纷享开放平台域名}/er/oauth/authorize?responseType=code&erAppId=xxxx&appId=FSAID_xxx&state=xxx&redirectUrl={urlencode的第三方页面地址}
| 参数 | 参数类型 | 必须 | 说明 |
|---|---|---|---|
| erAppId | String | 是 | 互联应用的appId |
| appId | String | 是 | 自建应用的appId |
| redirectUrl | String | 是 | 回调地址 |
| responseType | String | 是 | 固定值:code |
| state | String | 是 | client端的状态值。8-128位数字或者字符。用于第三方应用防止CSRF攻击,成功授权后回调时会原样带回 |
页面点击该地址后会调整到redirectUrl对应的地址上,并带上code,例如:
https://{第三方系统地址}?code=xxxxxx
# 通过自建互联应用打开第三方系统
步骤: 1.准备一个回调地址,例如 https://www.xxx.com/callback \2. 通过联系纷享客服,在上游创建用于单点登录的互联应用 3.在上游企业互联应用中,将该互联应用授权给要登录的下游企业 4.下游点击登录应用会跳转到第一步配置的回调地址,并且会传递给该地址一个code参数,code有10分钟过期时间。例如:https://www.xxx.com/callback?code=xxxx