All Products
Search
Document Center

Elastic Desktop Service:GetLoginToken

Last Updated:Oct 28, 2026

Retrieves logon credentials.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to query the regions supported by Elastic Desktop Service.

cn-hangzhou

ClientId

string

Yes

The unique ID generated by the client.

f4a0dc8e-1702-4728-9a60-95b27a35****

DirectoryId

string

No

The ID of the workspace. This parameter has the same meaning as OfficeSiteId. We recommend that you use OfficeSiteId instead of DirectoryId. You can specify only one of DirectoryId and OfficeSiteId.

cn-hangzhou+dir-885351****

OfficeSiteId

string

No

The ID of the workspace.

cn-hangzhou+dir-885351****

SessionId

string

No

The session ID for logon.

  • If no virtual MFA device is bound or client-side secondary authentication is not enabled, you do not need to specify SessionId.

  • If a virtual MFA device is bound or client-side secondary authentication is enabled, you must specify SessionId in the logon authentication stages after ADPassword. You can obtain SessionId from the response of the convenience account verification (when the GetLoginToken request is in the ADPassword stage).

cd45e873-650d-4d70-acb9-f996187a****

CurrentStage

string

No

The current logon authentication stage. Valid values:

  • ADPassword: verifies user information. Specify this value when password-based authentication is used for a convenience account or an Active Directory (AD) account.

  • MFABind: binds a virtual MFA device.

  • MFAVerify: verifies the security code generated by the virtual MFA device.

  • TokenVerify: performs client-side secondary authentication.

  • ChangePassword: changes the user password.

  • KeepAliveVerify: exchanges a valid KeepAliveToken for a LoginToken.

ADPassword

EndUserId

string

No

The username of the convenience user or AD user. This parameter is required when CurrentStage is set to ADPassword.

alice

Password

string

No

The password of the convenience user or AD user. This parameter is required when CurrentStage is set to ADPassword.

Password1234

OldPassword

string

No

The old password. This parameter is required when CurrentStage is set to ChangePassword.

OldPassword

NewPassword

string

No

The new password. This parameter is required when CurrentStage is set to ChangePassword.

NewPassword

AuthenticationCode

string

No

The security code generated by the virtual MFA device. This parameter is required when CurrentStage is set to MFAVerify.

47****

ClientOS

string

No

The operating system of the device on which the client runs.

Windows_NT 10.0.18363 x64

ClientVersion

string

No

The client version. If you use the Wuying client, you can view this parameter in the About dialog box on the client logon page.

2.1.0-R-20210731.151756

TokenCode

string

No

The verification code for secondary authentication. If client-side secondary authentication is enabled in the Elastic Desktop Service console and the current logon user is identified as risky, the verification code is sent to the email address of the end user. This parameter is required when CurrentStage is set to TokenVerify.

63****

KeepAlive

boolean

No

Specifies whether to keep the user logged on.

Valid values:

  • null :

    null: Do not keep the user logged on. Default value.

  • false :

    false: Do not keep the user logged on.

  • true :

    true: Keep the user logged on.

false

KeepAliveToken

string

No

The token used to keep the user logged on. After a successful logon and if the user enables the keep-logged-on option, the API returns KeepAliveToken. Within the validity period of KeepAliveToken, you can call the GetLoginToken operation and set CurrentStage to KeepAliveVerify to exchange it for a logon token (LoginToken). This parameter is required when CurrentStage is set to KeepAliveVerify.

hide

Uuid

string

No

The unique identifier of the client. If you use the Wuying client, you can view this parameter in the About dialog box on the client logon page.

C78CA9E99315687575DD2844C1F3****

ClientType

string

No

The type of the Wuying software client.

Valid values:

  • HTML5 :

    HTML5: Web client.

  • MACOS :

    MACOS: macOS client.

  • WINDOWS :

    WINDOWS: Windows client.

  • ANDROID :

    ANDROID: Android client.

  • IOS :

    IOS: iOS client.

WINDOWS

AvailableFeatures

object

No

The features supported by the client.

string

No

The features supported by the client.

1

ClientName

string

No

The name of the client.

demo-client

Response elements

Element

Type

Description

Example

object

The response information.

Email

string

The email address of the user. This parameter is returned along with LoginToken after logon.

  • For a convenience user, the email address specified when the convenience user was created is returned.

  • For an AD user, the email address is returned in the following format: Username@AD domain name.

alice

Secret

string

The secret key used to attach a virtual MFA device. Used in the MFABind stage.

Note

For more information about each authentication stage, see the metric description of the CurrentStage request parameter.

5OCLLKKOJU5HPBX66H3QCTWYI7MH****

RequestId

string

The request ID.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

EndUserId

string

The username of the convenience account or AD user.

alice

LoginToken

string

The logon token.

v18101ac6a9e69c66b04a163031680463660b4b216cd758f34b60b9ad6a7c7f7334b83dd8f75eef4209c68f9f1080b****

NextStage

string

The expected next stage. For example, if the administrator enables MFA authentication in the Elastic Desktop Service console, this parameter returns MFAVerify after the username and password authentication succeeds (that is, after the ADPassword stage). This indicates that MFA authentication is required.

Note

For more information about each authentication stage, see the metric description of the CurrentStage request parameter.

MFAVerify

QrCodePng

string

The QR code of the secret key used to attach a virtual MFA device. Uses Base64 encoding. This parameter can be empty and is used in the MFABind stage.

Note

For more information about each authentication stage, see the metric description of the CurrentStage request parameter.

5OCLLKKOJU5HPBX66H3QCTWY******

Label

string

The properties of the convenience user. If the user is an AD user, an empty value is returned.

test:wuying

SessionId

string

The session ID. This parameter is returned only when GetLoginToken is invoked for the first time in the same session. If multiple authentication steps are required, you must pass this parameter in subsequent stages.

Note

For more information about each authentication stage, see the metric description of the CurrentStage request parameter.

d6ec166d-ab93-4286-bf7f-a18bb929****

Phone

string

The mobile phone number of the convenience user. If the user is an AD user, an empty value is returned.

1381111****

TenantId

integer

The Alibaba Cloud account ID. This parameter is used for hardware terminal identification.

166353906220****

KeepAliveToken

string

The token used to keep the user logged on. After a successful logon and if the user enables the keep-logged-on option, the API returns KeepAliveToken. If the keep-logged-on option is not enabled, an empty value is returned.

006YwvYMsesWWsDBZnVB+Wq9AvJDVIqOY3YCktvtb7+KxMb3ClnNlV8+l/knhZYrXUmeP06IzkjF+IgcZ3vZKOyMprDyFHjCy1r27FRE/U7+geWCl8iQ+yF8GaCRHfJEkC2+ROs93HkT4tfHxyY1J8W7O7ZQGUC/cdCvm+cCP6FIy73IUuPuVR6PcKYXIpEZPW

Industry

string

Note

Internal private field. Not available for external use.

edu

Props

object

Note

Internal private field. Not available for external use.

string

Note

Internal private field. Not available for external use.

{'dingUserName': u'\u674e\u66fc', 'role': 'student'}

WindowDisplayMode

string

Note

Internal private field. Not available for external use.

mode

RiskVerifyInfo

object

The logon risk identification information.

Email

string

The email address used for verification when identity verification is triggered.

user@example.com

LastLockDuration

integer

The account lockout duration.

1713749778

Locked

string

Indicates whether the account is locked.

Valid values:

  • false :

    false: No.

  • true :

    true: Yes.

true

Phone

string

The mobile phone number used for verification when identity verification is triggered.

1381111****

Reason

string

Note

Internal private field. Not available for external use.

null

PasswordStrategy

object

Note

Internal private field. Not available for external use.

TenantPasswordLength

string

Note

Internal private field. Not available for external use.

null

TenantAlternativeChars

array

Note

Internal private field. Not available for external use.

string

Note

Internal private field. Not available for external use.

null

NickName

string

The nickname of the user.

user-001

WyId

string

0123456789abcdef

OfficeSiteId

string

The ID of the workspace.

cn-hangzhou+dir-885351****

OfficeSiteName

string

The name of the workspace.

test

Examples

Success response

JSON format

{
  "Email": "alice",
  "Secret": "5OCLLKKOJU5HPBX66H3QCTWYI7MH****",
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****",
  "EndUserId": "alice",
  "LoginToken": "v18101ac6a9e69c66b04a163031680463660b4b216cd758f34b60b9ad6a7c7f7334b83dd8f75eef4209c68f9f1080b****",
  "NextStage": "MFAVerify",
  "QrCodePng": "5OCLLKKOJU5HPBX66H3QCTWY******",
  "Label": "test:wuying",
  "SessionId": "d6ec166d-ab93-4286-bf7f-a18bb929****",
  "Phone": "1381111****",
  "TenantId": 0,
  "KeepAliveToken": "006YwvYMsesWWsDBZnVB+Wq9AvJDVIqOY3YCktvtb7+KxMb3ClnNlV8+l/knhZYrXUmeP06IzkjF+IgcZ3vZKOyMprDyFHjCy1r27FRE/U7+geWCl8iQ+yF8GaCRHfJEkC2+ROs93HkT4tfHxyY1J8W7O7ZQGUC/cdCvm+cCP6FIy73IUuPuVR6PcKYXIpEZPW",
  "Industry": "edu",
  "Props": {
    "key": "{'dingUserName': u'\\u674e\\u66fc', 'role': 'student'}"
  },
  "WindowDisplayMode": "mode",
  "RiskVerifyInfo": {
    "Email": "user@example.com",
    "LastLockDuration": 1713749778,
    "Locked": "true",
    "Phone": "1381111****"
  },
  "Reason": "null",
  "PasswordStrategy": {
    "TenantPasswordLength": "null",
    "TenantAlternativeChars": [
      "null"
    ]
  },
  "NickName": "user-001",
  "WyId": "0123456789abcdef",
  "OfficeSiteId": "cn-hangzhou+dir-885351****",
  "OfficeSiteName": "test"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.