Docs/Security/Two-factor authentication
DartRelay 2.1 documentation
Security

Two-factor authentication

Two-factor authentication asks for something the person has — a code from an app on their phone, or a code sent to their mailbox — as well as the password they know. This page explains how to switch it on for the portal and the console, and what your users see.

Why use two-factor authentication

Passwords get reused, guessed and leaked. With two-factor authentication switched on, a stolen password on its own is not enough to sign in: the attacker also needs the person's phone or mailbox. For a portal published on the internet, and above all for the admin console, it is the single most effective protection you can add.

The two methods

MethodHow it worksGood for
Authenticator AppThe person scans a code into an authenticator app (Microsoft Authenticator, Google Authenticator and similar) once. From then on the app shows a short code that changes every few seconds, which they type at sign-in. It works with no network connection on the phone.Administrators, and anyone with a smartphone. The stronger of the two.
Email one-time codeAfter the password, DartRelay emails a six-digit code to the address on the person's account. They type it in to finish signing in.People without a smartphone. It needs working email delivery and an email address on each account.

Before you begin

Switching two-factor authentication on

The portal and the console are configured separately, so you can, for example, require it on the console while leaving it optional on the portal.

  1. Open the Security page. In the console, go to Authentication → Security. The two-factor settings are in the first card.
  2. Choose the mode for the admin console. Modes run from disabled (no second step) to mandatory (everyone must use it).
  3. Choose the mode for the portal.
  4. Choose the methods to offer. Tick Authenticator App to offer app codes. Switch on email codes to offer those.
  5. Set the grace period. When two-factor authentication is mandatory, the grace period is the number of days people have to set it up before they can no longer sign in without it. The console and the portal each have their own.
  6. Click Save under the two-factor card. The card saves on its own, separately from the other cards on the page.

Saving the Security page sends the security-settings message to the Admin Notification Emails list, so other administrators know the setting changed.

Tip

Make it mandatory on the console first. Administrators can change everything, so their accounts are the most valuable to an attacker, and they are the easiest group to help through setting it up.

Example: a sensible starting point

A practice with 40 staff publishes its clinical system to home workers. The administrator sets the console to mandatory with Authenticator App only, and a short grace period for the two IT staff. For the portal they offer both methods with a longer grace period, so staff without a work phone can use email codes, and they announce the change on the sign-in page with an Announcement a week ahead.

How people set it up

When a method is offered on the portal, the person's profile page shows a card for it. When two-factor authentication is switched off, those cards are not shown at all.

  1. Open the profile. In the portal, open the account menu and choose the profile page.
  2. Set up the authenticator app. In the authenticator card, scan the code shown on screen with the app and follow the prompts on the page.
  3. Keep the recovery codes. DartRelay gives a set of one-time recovery codes. Each can be used once in place of an app code, for example if the phone is lost. Store them somewhere safe and separate from the phone.

People manage their authenticator devices and recovery codes from the same profile page. See Signing in and out for the end-user view.

Important

Recovery codes are a limited set. Someone who has used them all and lost their phone needs an administrator's help to get back in.

What signing in looks like

  1. The person types their username and password as usual.
  2. DartRelay shows the next step on the same branded sign-in page — the theme's logo, background and colours stay in place, and the code form takes the place of the sign-in form.
  3. For an app code, they type the code the app is showing (or a recovery code). For an email code, the page says where the code was sent, with most of the address hidden, for example jo****@example.com.
  4. Once the code is accepted, they arrive at My Resources.

Email codes in detail

Important

Switching the Email one-time code template off means no code is sent at all, so nobody can complete an email second step. To stop using email codes, switch the method off on Authentication → Security instead. The template editor repeats this warning beside the switch.

Note

Email codes and self-service password reset links go to the same mailbox. If you use both, someone with access to a person's mailbox could reset the password and receive the code. For stronger protection, prefer the authenticator app. See Self-service password reset.

After a forced password change

When someone has to change an expired password, the change screen sends them back to sign in normally afterwards. The second step is asked for then, so a password change never skips two-factor authentication.

If something goes wrong

Authenticator codes are always refused

The clock on the phone or on the DartRelay server is probably wrong. Set both to synchronise their time automatically and try again.

No email code arrives

Check that the account has an email address, that the Email one-time code template is switched on under Email → Templates, and that email delivery works by sending a test from the template editor. Check the recipient's junk folder. If the page says a code could not be sent, its reason tells you which of these to look at.

Someone is locked out after mistyping codes

Wrong codes count towards the lockout for their network address. They can try again once the lockout duration on System → Settings has passed. A correct sign-in then clears the count.

The two-factor cards are missing from the profile page

They appear only when a method is offered for the portal on Authentication → Security.

Still stuck? Email support@dartinnovations.com with what you were doing, what you expected and what you saw. A screenshot helps.