Get Two-Factor Authentication Secret

GET/zstack/v1/twofactorauthentication/secret

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-X GET http://localhost:8080/zstack/v1/twofactorauthentication/secret?name=user1&password=password&type=ldap

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

name

String

query

Resource name

 

4.10.0

password

String

query

 

 

4.10.0

captchaUuid (optional)

String

query

 

 

4.10.0

verifyCode (optional)

String

query

 

 

4.10.0

systemTags (optional)

List

query

 

 

4.10.0

userTags (optional)

List

query

 

 

4.10.0

type

String

query

 

  • account
  • ldap

5.0.0

API Response

Response example

{
  "inventory": {
    "uuid": "7870dee14bdb328c9eb6635f4f494fdd",
    "secret": "ABCDEFGH12345678",
    "status": "NewCreated",
    "userType": "AccountVO"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error2.6.0
inventoryTwoFactorAuthenticationSecretInventoryFor details, see inventory2.6.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.10012.6.0
descriptionStringA brief description of the error2.6.0
detailsStringThe detailed error information2.6.0
elaborationStringReserved field. Defaults to null2.6.0
opaqueLinkedHashMapReserved field. Defaults to null2.6.0
causeErrorCodeThe root error, the cause of the current error. This field is null if there is no root error2.6.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe resource UUID, uniquely identifying this resource2.6.0
secretStringTwo-factor authentication secret2.6.0
createDateTimestampCreation time3.4.0
lastOpDateTimestampLast modification time3.4.0
userUuidStringUser UUID3.4.0
userTypeString 3.4.0
statusTwoFactorAuthenticationSecretStatusFor details, see status3.4.0

status

NameTypeDescriptionStarting Version
nameStringResource name3.4.0
ordinalint 3.4.0

SDK Examples

Java SDK

GetTwoFactorAuthenticationSecretAction action = new GetTwoFactorAuthenticationSecretAction();
action.name = "user1";
action.password = "password";
action.type = "ldap";
GetTwoFactorAuthenticationSecretAction.Result res = action.call();

Python SDK

action = GetTwoFactorAuthenticationSecretAction()
action.name = "user1"
action.password = "password"
action.type = "ldap"
res = action.call()