Skip to main content

Authentication Interface Definition

Download OpenAPI specification:Download

Contact Developer: openapi@supos.com
  • oauth2.0 service interface

Authentication

Sign

Security Scheme Type: API Key
Header parameter name: Authorization

Token

Security Scheme Type: HTTP
HTTP Authorization Scheme: bearer
Bearer format: JWT

OAuth2

OAuth2 authentication

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:
SignToken
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

Content type
application/json
{
  • "grantType": "authorization_code",
  • "code": "string",
  • "logoutUri": "string",
  • "refreshToken": "string"
}

Response samples

Content type
application/json
{
  • "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

Content type
application/json
{
  • "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

Content type
application/json
{
  • "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:
SignToken
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

Content type
application/json
{
  • "grantType": "authorization_code",
  • "code": "string",
  • "logoutUri": "string",
  • "refreshToken": "string"
}

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "expiresIn": "string",
  • "refreshToken": "string",
  • "username": "string",
  • "accountType": 0
}

V2.8.1

supOS V2.8.1 dedicated authentication interface, which will be discarded soon

Authorization address, about to be discarded Deprecated

Authorizations:
SignToken
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

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

Obtain token, will be discarded Deprecated

Authorizations:
SignToken
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

Content type
application/json
{
  • "accessToken": "string",
  • "expiresIn": "string",
  • "refreshToken": "string"
}

Refresh token, it will be discarded soon Deprecated

Authorizations:
SignToken
query Parameters
refreshToken
required
string

Refresh token

Responses

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "expiresIn": "string",
  • "refreshToken": "string"
}

Get username, will be obsolete Deprecated

Authorizations:
SignToken
query Parameters
accessToken
required
string

access token

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

The authentication token is valid and will be discarded soon Deprecated

Authorizations:
SignToken
path Parameters
accessToken
required
string

access token

Responses

Response samples

Content type
application/json
{
  • "valid": true
}

Signed out, about to be discarded Deprecated

Authorizations:
SignToken
query Parameters
accessToken
required
string

access token

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}