Help Center/ Meeting/ Server API Reference/ Login Authentication/ APIs/ Performing Proxy Authentication
Updated on 2023-12-22 GMT+08:00

Performing Proxy Authentication

Description

This API is used to authenticate a third-party proxy account. After the authentication is successful, an access token is generated. Currently, the following third-party proxy accounts are supported:

  • WeLink accounts and passwords
  • Third-party accounts complying with OAuth 2.0
  • When clientType is set to 72, up to 64 tokens can be created for each account. If 64 tokens have been created using an account and the tokens are valid, creating a new token using the same account will invalidate the earliest token among the first 64 tokens.
  • When clientType is not set to 72, only one token can be created for each account.
  • A token is valid for 12 to 24 hours.

Debugging

You can debug this API in API Explorer.

Prototype

Table 1 Prototype

Request Method

POST

Request Address

/v1/usg/acs/auth/proxy

Transport Protocol

HTTPS

Request Parameters

Table 2 Parameters

Parameter

Mandatory

Type

Location

Description

Content-Type

Yes

String

Header

Media format of the body, for example, application/json; charset=UTF-8.

X-Request-ID

No

String

Header

Request ID, which is used for fault tracing and locating. You are advised to use a UUID. If this parameter is not carried, a request ID is automatically generated.

Accept-Language

No

String

Header

Language. Values: zh-CN for Chinese (default) and en-US for English.

account

No

String

Body

Authentication account.

maxLength: 255

minLength: 0

authServerType

Yes

String

Body

Authentication service type.

  • workplace: WeLink proxy authentication.
  • oauth2: OAuth 2.0 authentication.

authType

Yes

String

Body

Authentication mode.

  • AccountAndPwd: WeLink proxy authentication.
  • AuthCode: OAuth 2.0 authentication

clientType

Yes

Integer

Body

Type of the account used for login.

  • 72: API calling.

createTokenType

No

Integer

Body

Whether to generate a token. Default value: 0.

  • 0: A token is generated for login authentication.
  • 1: No token is generated.

credential

No

String

Body

If OAuth 2.0 is used, set this parameter to the temporary code obtained from the authentication center.

domain

No

String

Body

Enterprise domain name. This parameter is mandatory for OAuth 2.0 authentication.

pwd

No

String

Body

Authentication password. This parameter is mandatory for WeLink proxy authentication.

maxLength: 255

minLength: 0

remark

No

String

Body

Remarks.

Status Codes

Table 3 Status codes

HTTP Status Code

Description

200

Operation successful.

400

Invalid parameters.

401

Access denied.

403

Insufficient permissions.

412

The account has been disabled.

423

The account has been locked.

500

Server exception.

Response Parameters

Table 4 Response parameters

Parameter

Type

Description

accessToken

String

Access token.

clientType

Integer

Type of the account used for login.

  • 72: API calling.

createTime

Long

Timestamp when the token is created, in milliseconds.

daysPwdAvailable

Integer

Password validity period.

delayDelete

Boolean

Whether the token deletion is delayed.

expireTime

Long

Timestamp when the token expires, in seconds.

firstLogin

Boolean

Whether the login is the first login.

NOTE:

If you log in to the system for the first time, the system prompts you to change the initial password.

Default value: false.

forceLoginInd

Integer

Whether preemptive login is enabled.

  • 0: disabled.
  • 1: enabled. (This value is not provided.)

proxyToken

ProxyTokenDTO object

Proxy authentication information.

pwdExpired

Boolean

Whether the password has expired.

Default value: false.

refreshCreateTime

Long

Timestamp when a refresh token is created, in milliseconds.

refreshExpireTime

Long

Timestamp when the refresh token expires, in seconds.

refreshToken

String

Refresh token.

refreshValidPeriod

Long

Validity period of the refresh token, in seconds.

tokenIp

String

IP address of the user.

tokenType

Integer

Token type.

  • 0: user access token.
  • 1: meeting control token.
  • 2: one-off token.

user

UserInfo object

User authentication details.

validPeriod

Long

Validity period of the token, in seconds.

Example Request

POST /v1/usg/acs/auth/proxy
Connection: keep-alive
Content-Type: application/json
X-Request-ID: 5162fa32dc7e47afafeee39a72a2eec3
Accept-Language: zh-CN
Host: api.meeting.huaweicloud.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)

{
    "clientType": "72",
    "authServerType": "workplace",
    "authType": "AccountAndPwd",
    "pwd": "1qaz@WSX",
    "createTokenType": 0,
    "account": "zhangsan@cloudlinkwp"
}

Example Response

HTTP/1.1 200 
Date: Wed, 18 Dec 2019 06:20:40 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 745
Connection: keep-alive
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-XSS-Protection: 1; mode=block
X-Download-Options: noopen
X-Content-Type-Options: nosniff
strict-transport-security: max-age=16070400; includeSubDomains
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data: http: https: ; child-src * ; connect-src *
x-request-id: 5162fa32dc7e47afafeee39a72a2eec3
Server: CloudPortal

{
    "accessToken": "stbNxmD2UXEDkHQD73sqMhXB6eXw6ngvSbo9",
    "clientType": 0,
    "createTime": 1599102826754,
    "daysPwdAvailable": -18172,
    "delayDelete": false,
    "expireTime": 1577979513,
    "firstLogin": true,
    "forceLoginInd": null,
    "proxyToken": null,
    "pwdExpired": false,
    "refreshCreateTime": 1599102826754,
    "refreshExpireTime": 1601694826,
    "refreshToken": "stbYaza5VVRr3IGuLSs6ZvF0lMHHvGO0tQ0f",
    "refreshValidPeriod": 2592000,
    "tokenIp": "10.8.0.90",
    "tokenType": 0,
    "user": {
        "adminType": 2,
        "alias1": null,
        "appId": null,
        "cloudUserId": "76aaaba8a12f4c0a8a43192...",
        "companyDomain": null,
        "companyId": "f5968fc4f9c14d50905e8e66672dabc6",
        "corpType": 0,
        "freeUser": false,
        "grayUser": false,
        "headPictureUrl": null,
        "isBindPhone": null,
        "name": "xxxx_name",
        "nameEn": null,
        "numberHA1": "1ead5e5ce44849bc2718d5c....",
        "paidAccount": null,
        "paidPassword": null,
        "password": null,
        "realm": "huaweicloud.com",
        "serviceAccount": "sip:xxxx@huaweicloud.com",
        "spId": "666bd8558e4646e1a7e1a0c99cf898e8",
        "status": 0,
        "thirdAccount": "62fe180o133fd...",
        "tr069Account": "X3M537A6IX4SC...",
        "ucloginAccount": "z8b2vo875ioh54r29ad5e3552vb3gm8np2j167...",
        "userId": "0d5202707123429d876....",
        "userType": 2,
        "visionAccount": null,
        "weLinkUser": false
    },
    "validPeriod": 84616
}

Error Codes

If an error code starting with MMC or USG is returned when you use this API, rectify the fault by following the instructions provided in Huawei Cloud API Error Center.

Example cURL Command

curl -k -i -H 'content-type: application/json' -X POST  -H 'X-Request-ID: 5162fa32dc7e47afafeee39a72a2eec3,Content-Type: application/json,Accept-Language: zh-CN' -H 'date: 20190329T074551Z' -d '{"clientType":0,"authServerType":"workplace","authType":"AccountAndPwd","pwd":"1qaz@WSX","createTokenType":0,"account":"zhangsan@cloudlinkwp"}'
'https://api.meeting.huaweicloud.com/v1/usg/acs/auth/proxy'