Skip to Content

Two-factor authentication

Ask for a code from your phone at login, so a leaked password alone can't open your account

With two-factor authentication on, logging in to Plunk takes your password and a 6-digit code from an authenticator app on your phone. Someone who learns your password still can't get into your account, your projects or your API keys without that code.

Two-factor authentication is for accounts that log in with an email address and password. If you log in with GitHub or Google, your account is protected by that provider's login: turn on two-factor authentication there.

Turn it on

You need an authenticator app, such as 1Password, Google Authenticator or Authy.

Open your account settings

Open the account menu in the dashboard and choose Account settings. Under Security, find Two-factor authentication and click Set up.

Confirm your password

Plunk asks for your password before it changes how you log in.

Connect your authenticator app

Scan the QR code with your app. If you can't scan it, enter the key shown below the code instead. Then type the 6-digit code the app shows, to confirm it is connected.

Save your recovery codes

Plunk gives you 10 recovery codes. Each one logs you in once if you don't have your phone. They are only shown this once, so copy them or download them as a text file, and keep them somewhere safe, away from your phone, such as your password manager.

Two-factor authentication is on from this point. The Security section shows it as On, with the date you added it.

Logging in

After your email and password, Plunk asks for the 6-digit code from your authenticator app. If you don't have your phone, choose Use a recovery code and enter one of your saved codes instead.

You have 5 minutes and 5 tries to enter the code. After that, start again from your password. Too many wrong codes pause further attempts for up to 15 minutes, which stops anyone from guessing their way in.

Recovery codes

Each recovery code works once. The Security section shows how many you have left, and reminds you when you're down to the last two.

To replace them, click Create new codes, then confirm with your password and a code from your app. You get 10 new codes, and the old ones stop working.

If you lose your phone

  1. Log in with your password and a recovery code.
  2. In Account settings, turn two-factor authentication off.
  3. Set it up again with your new phone. This also gives you a fresh set of recovery codes.

Resetting your password doesn't turn two-factor authentication off: you still need a code to log in afterwards.

Keep your recovery codes

If you lose both your phone and your recovery codes, you can't log in on your own. Contact support from the email address on your account.

Turn it off

In Account settings, click Turn off next to two-factor authentication and confirm with your password and a code from your app or a recovery code. Logging in then only needs your password, and your authenticator app and recovery codes stop working.

Security emails

Plunk emails you whenever something about your second factor changes, so you notice a change you didn't make.

What happenedEmail
Two-factor authentication turned onLogging in now also asks for a code
Two-factor authentication turned offLogging in now only needs your password
New recovery codes createdYour previous codes no longer work
A recovery code was used to log inSomeone logged in with your password and a recovery code, and how many codes are left

If you get one of these emails and didn't make the change, someone has your password: reset it from the login page right away, then check your two-factor settings.

Self-hosting

Two-factor authentication is off by default on a self-hosted instance. Turn it on with two environment variables:

VariableValue
TWO_FACTOR_ENABLEDtrue
TWO_FACTOR_ENCRYPTION_KEY32 random bytes, base64-encoded: openssl rand -base64 32

The key encrypts each user's authenticator secret and recovery codes. The API refuses to start if TWO_FACTOR_ENABLED is true without a valid key. Keep it with your other secrets and never change it once people have set up two-factor authentication: Plunk can no longer read their secrets, and they can't log in.

Setting TWO_FACTOR_ENABLED back to false stops new set-ups, but anyone who already turned it on is still asked for a code, and can still turn it off from their account settings.

The security emails go out through Plunk's platform email, which needs PLUNK_API_KEY and PLUNK_FROM_ADDRESS. Without them, the changes still happen, but nobody is emailed.

On this page