# Generate authenticator code

Node type `browser_get2faCode`

## What it does

Generate the current time-based code from a configured authenticator secret.

## Desktop client configuration

![Generate authenticator code configuration in the desktop client](/assets/get2fa-code.881db20f1e13f1257ced12091ad41dce4366322b4c9e58bda81c7ebe008fa6d3.0538f3a9.webp)

Captured in the English interface of MoreLogin Desktop V2.73.101.

## Inputs

These fields belong in `data.browserUi.inputs`.

| Field | Type or values | Schema required | Execution default | Description and bounds |
|  --- | --- | --- | --- | --- |
| `secret` | `string` | No | — | 2FA secret |


## Mode requirements and limits

- secret is a Base32 key. When entered directly, it can contain only letters, digits, and spaces, up to 100 characters (validated on write; values of referenced variables are not validated). At run time, all non-word characters (spaces, -, =, and so on) are removed first. A real 6-digit TOTP is generated; no fixed demo code is used. expiresAt is the desktop client's local time when the current period (30 seconds) expires, in YYYY-MM-DD HH:mm:ss format, and remainingSeconds is the number of seconds remaining.
- Validation code `RPA_NODE_INPUT_INVALID`


## Input references

| Field | Allowed forms |
|  --- | --- |
| `secret` | `literal`, `template` |


## Outputs

| Output field | Type or values |
|  --- | --- |
| `code` | `string` |
| `expiresAt` | `string` |
| `remainingSeconds` | `number` |


Reference published fields as `${nodeId.data.field}`.

## JSON example

A complete node object for a workflow's `nodes` array or another node's `blocks`. `totpSecret` is a private initial parameter declared in `workflow.variables`.

```json
{
  "id": "totp_code",
  "type": "browser_get2faCode",
  "data": {
    "title": "Generate the sign-in code",
    "browserAction": "get2faCode",
    "browserUi": {
      "inputs": {
        "secret": "${totpSecret}"
      },
      "exception": {
        "timeout": 30000,
        "policy": "interrupt"
      }
    }
  }
}
```

[Back to the node catalog](/browser-rpa/nodes)