Get Two-Factor Authentication 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=ldapParameter 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 |
|
| 5.0.0 |
API Response
Response example
{
"inventory": {
"uuid": "7870dee14bdb328c9eb6635f4f494fdd",
"secret": "ABCDEFGH12345678",
"status": "NewCreated",
"userType": "AccountVO"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 2.6.0 |
| inventory | TwoFactorAuthenticationSecretInventory | For details, see inventory | 2.6.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.1001 | 2.6.0 |
| description | String | A brief description of the error | 2.6.0 |
| details | String | The detailed error information | 2.6.0 |
| elaboration | String | Reserved field. Defaults to null | 2.6.0 |
| opaque | LinkedHashMap | Reserved field. Defaults to null | 2.6.0 |
| cause | ErrorCode | The root error, the cause of the current error. This field is null if there is no root error | 2.6.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID, uniquely identifying this resource | 2.6.0 |
| secret | String | Two-factor authentication secret | 2.6.0 |
| createDate | Timestamp | Creation time | 3.4.0 |
| lastOpDate | Timestamp | Last modification time | 3.4.0 |
| userUuid | String | User UUID | 3.4.0 |
| userType | String | 3.4.0 | |
| status | TwoFactorAuthenticationSecretStatus | For details, see status | 3.4.0 |
status
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | Resource name | 3.4.0 |
| ordinal | int | 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()