> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/generic/other-operations/generate-totp.md).

# Generate TOTP

This is a pre-built action located under the **@Generic** element type. The action generates a Time-Based One-Time Password (TOTP) for applications protected by Multi-Factor Authentication (MFA). The TOTP is generated according to the RFC 6238 standard.

{% hint style="info" %}
**Notes:**

* **Supported MFA type:** Supports only OATH/TOTP with Base32 secret - based MFA, including Microsoft Authenticator when configured for TOTP.
* **Unsupported MFA type:** Does not support SMS OTP, FIDO2/WebAuthn, push-based MFA, number-matching MFA or Microsoft Authenticator activation Code + URL.
* To generate a TOTP, obtain the Base32 TOTP secret key from your MFA or authenticator configuration and encrypt it using the [Advanced Encryption Standard method (AES)](/avo-assure/utilities/encryption.md#encryption-method-in-avo-assure) .&#x20;
  {% endhint %}

## Syntax

**Input Value**: \<Encrypted Secure Key>

| Argument                                       | Description                                       |
| ---------------------------------------------- | ------------------------------------------------- |
| <p>\<Encrypted Secure Key> <br>(Required) </p> | Specify the secret key used to generate the TOTP. |

**Output Value**: \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional)

| Argument                                   | Description                                                  |
| ------------------------------------------ | ------------------------------------------------------------ |
| <p>\<Dynamic Variable> <br>(Optional) </p> | Stores the generated time-based one-time password.           |
| <p>\<Dynamic Variable> <br>(Optional) </p> | Stores the action execution status as **True** or **False**. |

#### **Example: Generating a TOTP for Application Login (MFA)**

In this example, we show how to generate a TOTP using an encrypted secret key and use it to complete login for an application with MFA enabled.

* **Action:** Generate TOTP
* **Input Value:** \<Encrypted Secret Key>
  * The value **Encrypted Secret Key** specifies the encrypted TOTP secret key, generated beforehand using the [Advanced Encryption Standard method (AES)](/avo-assure/utilities/encryption.md#encryption-method-in-avo-assure).
* **Output Value**: {GetOTP}
  * The **{GetOTP}** first output variable stores the generated time-based one-time password.
* **Logical Explanation:** The **Generate TOTP** action fetches the encrypted secret key from the Input Value column. This action generates time-based one-time password and stores it in the output variable **{GetOTP}**.<br>

  ![](https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FWepDwUHBjKZRG74FRvPp%2Funknown.png?alt=media\&token=8d224688-a598-485d-81f7-15b3fa0ba34d)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/other-operations/generate-totp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
