Updated on 2023-12-22 GMT+08:00

Performing Authentication

Description

This API is used to authenticate Huawei Cloud Meeting account and password. After the authentication is successful, an access token is generated.

  • 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/account

Transport Protocol

HTTPS

Request Parameters

Table 2 Parameters

Parameter

Mandatory

Type

Location

Description

Authorization

Yes

String

Header

Authorization information, which carries the user account and password. The account and password need to be transcoded using Base64.

  • Rule

Basic Base64(username:password)

  • Example

Basic eWMyOjE5OTUwwWWM=

NOTE:

The password contains 8 to 32 characters.

Content-Type

Yes

String

Header

Media format of the body.

  • 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.

HA2

No

String

Body

Verification code information, which is returned by the server in verification code scenarios.

account

Yes

String

Body

User account (Huawei Cloud Meeting account).

  • Example: zhangsan@huawei

Apply for an account in advance. For details, see Development Process.

NOTE:
  • The account must contain 1 to 255 characters.

clientType

Yes

Integer

Body

Type of the login client.

  • 72: API calling.

createTokenType

No

Integer

Body

Whether to generate a token. The default value is 0.

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

Status Codes

Table 3 Status codes

HTTP Status Code

Description

200

Operation successful.

400

Invalid parameters.

401

Access denied.

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 access token was created, in milliseconds.

daysPwdAvailable

Integer

Password validity period.

expireTime

Long

Timestamp when the access 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.

proxyToken

ProxyTokenDTO object

Proxy authentication information.

pwdExpired

Boolean

Whether the password has expired.

Default value: false.

refreshCreateTime

Long

Timestamp when a refresh token was 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 login 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 access token, in seconds.

forceLoginInd

Integer

Whether preemptive login is enabled.

  • 0: disabled.
  • 1: enabled.

delayDelete

Boolean

Whether the token deletion is delayed.

Table 5 ProxyTokenDTO data structure

Parameter

Type

Description

accessToken

String

Short token of the proxy server, a string.

enableRerouting

Boolean

Whether to enable secondary route.

longAccessToken

String

Long token of the proxy server, a string.

middleEndInnerUrl

String

Internal network address of the middle end.

middleEndUrl

String

URL of the middle end.

validPeriod

Long

Validity period of the token, in seconds.

Table 6 UserInfo data structure

Parameter

Type

Description

adminType

Integer

Administrator type.

  • 0: default administrator.
  • 1: common administrator.
  • 2: non-administrator, that is, common enterprise member. This value is valid only when userType is set to 2.

appId

String

App ID.

cloudUserId

String

Huawei Cloud account ID.

companyDomain

String

Enterprise domain name.

companyId

String

ID of the enterprise to which the user belongs.

corpType

Integer

Huawei Cloud Meeting service package edition.

  • 0: premium edition.
  • 5: free edition.
  • 6: standard edition.

freeUser

Boolean

Whether the login user is a free trial user.

grayUser

Boolean

Whether the login user is a gray user.

headPictureUrl

String

Profile picture link.

isBindPhone

Boolean

Whether a mobile number is bound to the account.

name

String

Username.

nameEn

String

English name of the user.

numberHA1

String

HA1 corresponding to the SIP number.

alias1

String

Alias of the user.

paidAccount

String

Paid terminal access account, which is used to log in to a smart TV.

paidPassword

String

Password of the paid terminal access account, which is used to log in to a smart TV.

password

String

Password of a free terminal access account, which is used to log in to a smart TV.

realm

String

Local authentication.

serviceAccount

String

SIP number associated with the user.

spId

String

ID of the SP that manages the enterprise to which the user belongs.

status

Integer

User status.

  • 0: normal.
  • 1: disabled.

thirdAccount

String

Third-party user account.

tr069Account

String

TR069 account.

ucloginAccount

String

Huawei Cloud Meeting account.

userId

String

UUID of a user.

userType

Integer

User type.

  • 1: SP administrator.
  • 2: enterprise user.
  • 3: free user.
  • 10: enterprise device user.
  • 11: anonymous user.
  • 12: smart TV user.
  • 13: IdeaHub user.
  • 14: whiteboard (SmartRooms) user.

visionAccount

String

Smart TV ID.

weLinkUser

Boolean

Whether the user is a WeLink user.

Example Request

POST /v1/usg/acs/auth/account
Connection: keep-alive
Authorization: Basic dGVzdDp0ZXN0
Content-Type: application/json
Content-Length: 94
Host: api.meeting.huaweicloud.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)

{
    "account": "zhangsan@huawei.com",
    "clientType": 72,
    "createTokenType": 0
}

Example Response

HTTP/1.1 200 OK
Date: Tue, 17 Dec 2019 09:32:47 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 591
Connection: keep-alive
X-Request-Id: f90fbd8714328398fcbedddde0f1303c

{
    "accessToken": "cnr1810Ukd9iiytRVdcrK3LiSj0KrGHl6IbtGIgz",
    "clientType": 72,
    "createTime": 1663576164818,
    "daysPwdAvailable": -18172,
    "delayDelete": false,
    "expireTime": 1663657182,
    "firstLogin": true,
    "forceLoginInd": null,
    "proxyToken": null,
    "pwdExpired": false,
    "refreshCreateTime": 1663576164818,
    "refreshExpireTime": 1666168164,
    "refreshToken": "cnr1810GCy8II2HIuNitisGTsl7FELztZ3PvQf9D",
    "refreshValidPeriod": 2592000,
    "tokenIp": "10.8.0.90",
    "tokenType": 0,
    "user": {
        "adminType": 2,
        "alias1": null,
        "appId": null,
        "cloudUserId": null,
        "companyDomain": null,
        "companyId": "972897387",
        "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:+99111217192335617@huaweicloud.com",
        "spId": "666bd8558e4646e1a7e1a0c99cf898e8",
        "status": 0,
        "thirdAccount": "zhangsan@huawei.com",
        "tr069Account": "",
        "ucloginAccount": "zhangsan@huawei.com",
        "userId": "d2bee87b30544ee68562912fb08b1074",
        "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 'Authorization:Basic dGVzdDp0ZXN0' -d '{"account": "user01","clientType": 72,"createTokenType": 0}' 'https://api.meeting.huaweicloud.com/v1/usg/acs/auth/account'