oAuth授权

POST /esignglobal/v1/oauth2/accessToken

接口描述

通过app_idapp_secret获取鉴权BEARER_TOKEN,用来请求后续业务API。Token有效时长为24小时。

请求参数

参数名称

类型

必填

说明

client_id

string

true

应用账号,即app_id

请先注册 eSignGlobal 账号并创建应用后获取。

client_secret

string

true

应用密码,即app_secret

请先注册 eSignGlobal 账号并创建应用后获取。

grant_type

string

true

授权类型,支持以下类型:

client_credentials

authorization_code

refresh_token

code

string

false

授权码,用户授权完成后由eSignGlobal返回

,grant_type为authorization_code时必传

refresh_token

string

false

刷新token,只有在

grant_type为refresh_token时,才需要提供

刷新令牌

请求示例

curl --location 'http://………………/esignglobal/v1/oauth2/accessToken' \
--form 'client_id="LZn…………g89"' \
--form 'client_secret="5ugL0rM………………Yne7b"' \
--form 'grant_type="client_credentials"' \

响应参数

参数名称

类型

说明

access_token

string

鉴权Token用于接口请求鉴权

expires_in

int

Token 距离过期剩余的时间

单位:秒

scope

string

权限范围

  • 当grant_type为client_credentials时,返回固定值:read-write
  • 当grant_type 为authorization_code 或

refresh_token时,返回对应的授权范围

token_type

string

Token 类型

固定值:bearer

refresh_token

string

用于刷新token,仅当grant_type为authorization_code

或refresh_token时返回,有效期为30个自然日,过期后

需要重新授权

响应示例

{
    "access_token": "eyJhbGciOiJIUzI1N………………th1pMM3oYk",
    "expires_in": 86398,
    "scope": "read-write",
    "token_type": "bearer"
}

 

接口描述
请求参数
请求示例
响应参数
响应示例