Authentication Interface Definition
Download OpenAPI specification:Download
- oauth2.0 service interface
Authorization code mode to obtain Access Token and refresh token
- When grantType is authorization_code, code and logouutUri are required
- When grantType is refresh_token, refresh_token is required
Authorizations:
Request Body schema: application/json
grantType | string Enum: "authorization_code" "refresh_token" type |
code | string authorizeCode obtained by authorization code mode |
logoutUri | string token invalidation callback third-party application exit address |
refreshToken | string refresh token |
Responses
Request samples
- Payload
{- "grantType": "authorization_code",
- "code": "string",
- "logoutUri": "string",
- "refreshToken": "string"
}
Response samples
- 200
- 400
- 401
{- "accessToken": "string",
- "expiresIn": "string",
- "refreshToken": "string",
- "username": "string",
- "personCode": "string",
- "companyCode": "string",
- "accountType": 0
}
Add a third-party certification authority
- Built-in: clinetType = internal
- Lanzhuoyun: protocolType = bluetron
- When enable is false, the third-party certification center is not enabled by default, you need to contact the system administrator to enable the certification center
Request Body schema: application/json
clientType required | string Value: "internal" Client type internal: built-in |
protocolType required | string Value: "bluetron" Protocol type bluetron: bluetron |
clientName | string Client Name |
enabled | boolean Whether to enable true: enabled, false: not enabled |
clientId required | string client id |
clientSecret required | string Client Secret |
authorizationUri required | string Authorization Address |
tokenUri required | string token address |
userinfoUri required | string User Information Address |
logoutUri required | string logout address |
Responses
Request samples
- Payload
{- "clientType": "internal",
- "protocolType": "bluetron",
- "clientName": "test1",
- "enabled": true,
- "clientId": "test",
- "clientSecret": "xxxxx",
- "authorizationUri": "http[s]://{host:port}/{prefix}/authrize",
- "tokenUri": "http[s]://{host:port}/{prefix}/token",
- "userinfoUri": "http[s]://{host:port}/{prefix}/userinfo",
- "logoutUri": "http[s]://{host:port}/{prefix}/logout"
}
Response samples
- 200
- 400
{- "redirectUri": "http[s]://xxx/xx/xxx/xxx/authrize?protocolType=bluetron"
}
Authorization code mode to obtain Access Token and refresh token, which will be discarded soon and migrated to /auth/v2/oauth2/token Deprecated
- When grantType is authorization_code, code and logouutUri are required
- When grantType is refresh_token, refresh_token is required
Authorizations:
Request Body schema: application/json
grantType | string Enum: "authorization_code" "refresh_token" type |
code | string authorizeCode obtained by authorization code mode |
logoutUri | string token invalidation callback third-party application exit address |
refreshToken | string refresh token |
Responses
Request samples
- Payload
{- "grantType": "authorization_code",
- "code": "string",
- "logoutUri": "string",
- "refreshToken": "string"
}
Response samples
- 200
- 400
- 500
{- "accessToken": "string",
- "expiresIn": "string",
- "refreshToken": "string",
- "username": "string",
- "accountType": 0
}
Authorization address, about to be discarded Deprecated
Authorizations:
query Parameters
responseType required | string Authorization type, this value is fixed as code. |
appid required | string The appid assigned to the application after successful login of the application account. |
redirectUri required | string Callback address after successful authorization. |
state required | string The status value of the client side. |
scope | string A list of authorizations. |
Responses
Response samples
- 400
{- "code": "string",
- "message": "string"
}
Obtain token, will be discarded Deprecated
Authorizations:
query Parameters
grantType required | string Authorization type, this value is fixed as authorization_code. |
appid required | string The appid assigned to the application after successful login of the application account. |
code required | string authorizeCode obtained by authorization code mode |
logoutUri | string APP logout link |
Responses
Response samples
- 200
- 400
{- "accessToken": "string",
- "expiresIn": "string",
- "refreshToken": "string"
}