Skip to main content

Pick a method

Use a login made for the workflow, such as a service account.

Authenticator app

1

Get the setup key

Turn on two-factor with an authenticator app on the portal. Copy the setup key. If the site shows only a QR code, take a screenshot of it.
2

Store it on the secret

On the Secrets tab of the Logins page, add a TOTP seed field to the portal’s username and password secret. Paste the setup key or an otpauth://totp/ link, or upload the QR code screenshot. Check that the live code matches your authenticator app.
3

Use it

An agent node generates codes with the Generate TOTP skill. A script uses asteroid.generateTotp.
Keep your own copy of the setup key. A TOTP seed is write-only.
Generate the code right before you submit it. See Two-factor codes. To collect a setup key from the account owner, send a request from the Requests tab of the Logins page. Requests need the Startup plan or above. See Collect secrets in your own app.

Email codes

In the mailbox that receives the codes, add a forwarding rule that sends them to the profile’s inbox, {prefix}@agentmail.asteroid.ai. An agent node reads the code with get_mail. Scripts cannot read mail. Needs the Startup plan or above. See Email inbox.

SMS, push and other methods

To forward SMS codes to the profile’s email inbox, use a third-party tool, such as an Apple Shortcut. The workflow then reads them as email codes. Otherwise, a person enters the code, or approves the push, while the run waits.
  • Agent node: turn on Ask User Questions. The run pauses with paused_by_agent. Reply on the execution page, or with POST /executions/{id}/user-messages. See Ask user question.
  • Script: ask with waitForReply. Answer on the execution page, with asteroid execution answer, or with POST /executions/{id}/answers. See Ask a question.
To be told when a run waits, send EXECUTION_PAUSED to a webhook or Slack. See Webhooks and Slack.
An unanswered agent question ends the run at the workflow’s timeout. An unanswered script question throws ReplyTimeoutError. For unattended runs, use an authenticator app.
For another two-factor setup, contact support.

Fewer codes

Reuse the session so runs sign in less often. Set Auth strategy in the environment’s Auth step. See Warm cache and Warm pool.