Guide

Let only listed people in with email codes

Let only the people you list open a tunnel, by emailing each of them a six-digit code when they visit.

Applies to
Starter and higher; durable tunnels
Time
About 5 minutes
What it changes
Visitors must sign in with an emailed code, and your app is disconnected for a moment while the tunnel reconnects.
Last reviewed
, by Product documentation

Before you begin

What to know before you start

  • Turning on email codes replaces a password or access token on the tunnel. A tunnel has one access mode at a time.
  • Email codes are for people with a browser. A script, an AI client or a webhook provider cannot read an email, so use an access token for those.
  • Turning it on ends the tunnel's live connection. Your connector reconnects on its own in a moment.

Steps

  1. Step 1. Open the tunnel in the dashboard and open the Email codes section.

    You should see: You see a box for allowed addresses and a choice of how long a visitor stays signed in.

  2. Step 2. List who may open the tunnel, one entry per line.

    Write a full address such as ada@example.com, or a whole domain such as @example.com. You can list up to 100 entries.

    You should see: The box shows how many entries you have, and names any line that is not a valid address or domain.

  3. Step 3. Choose how long a visitor stays signed in, from 1 to 24 hours, then choose Turn on email codes.

    Eight hours covers a working day. When the time ends the visitor asks for a new code.

    You should see: The dashboard shows the section as on. Your app reconnects on its own in a moment.

  4. Step 4. Open the tunnel's address in a private window and enter an address from your list.

    The page says that if the address is allowed in, a code was sent to it. It says the same for every address, so nobody can use it to find out who is on your list.

    You should see: An email with a six-digit code arrives.

    To check: Enter the code. Your app opens. Try an address that is not on the list: no email arrives.

You are done when

  • Opening the address in a private window shows a page that asks for an email address.
  • An address on your list receives a code, and the code opens your app.
  • An address that is not on your list never receives a code.

What to do next

If something goes wrong

No email arrives.
Check the spam folder and that the address is on the list exactly as the visitor typed it (the check ignores capital letters). Each address can ask for 5 codes an hour, and a tunnel for 20 codes an hour, so wait and try again if that was reached.
The code is refused.
A code works once, for 10 minutes, and allows five tries. Ask for a new code on the code page. Only the newest code works.
Visitors are asked to sign in again.
Changing the list, the sign-in time or the protection signs everyone out at once. They ask for a new code.
Tunnel Doctor says unverified.
Tunnel Doctor cannot read your email, so it reports the state as unverified. That is expected: the request stopped at the sign-in page.

Undo or clean up

  • Choose Turn off on the Email codes section. The tunnel becomes public again.

Was this page helpful?

We count yes and no for each page. Nothing that identifies you is kept with your answer.

This page is part of Share and protect. Still stuck? Contact support.