Skip to content
RecipesDoc

App with 2FA from an Authenticator App

Save the test account's 2FA setup key once, and every run makes the six-digit codes itself.

For apps where the test account must type a six-digit code from Google Authenticator, 1Password or a similar app.

Your setup

  • A web or mobile app with sign-in and authenticator 2FA (TOTP).
  • A test account made for testing, with 2FA turned on.
  • You want runs to sign in on their own, also at night.

Say this to Certyn

Our staging login asks for a 2FA code from an authenticator app. Set it up so your runs can sign in.

What Certyn does

  1. Opens the sign-in form for the test account. It saves LOGIN_USERNAME and LOGIN_PASSWORD.
  2. Opens a secret form for TOTP_SECRET. Paste the setup key you get when you turn on 2FA for the test account (often under can't scan the code?). The key with spaces, or the whole otpauth:// link behind the QR code, both work.
  3. Offers to restart the Machine, so it gets the new variables.
  4. Offers a short run that signs in, to check the setup. It asks before it starts the run.

You type the values only in the forms. The chat never sees them.

What you get

  • Runs that make the current code when the app asks, and sign in without help.
  • Scheduled and deploy-triggered runs that pass the 2FA step too.
  • For a second account, save its key under another name (for example ADMIN_TOTP_SECRET) and name that account in the goal or test case.

Limits

  • You need the setup key. If 2FA is already on and you lost the key, turn 2FA off and on again for the test account to get a new one.
  • Codes are made inside runs. While you watch on the chat's Machine, Certyn has no code tool: type the code yourself on the Machine, or let Certyn start a run.
  • Codes sent by SMS do not work. Use authenticator 2FA, or a test account without 2FA.