authcha learn

Learn / Foundations

Login flows, settings and lockouts

Module 6 of 6 · 20 minutes

By the end you can

  • Choose the right login flow for a device
  • Predict which setting wins when it is set at several levels
  • Explain the lockout rule and clear a lockout
  • Name the risk of password-only and where its use is recorded

Why there is more than one flow

Not every device can show a second prompt. Authcha supports three ways to log in, and you choose per device.

FlowHow the user logs inUse it for
Challenge (default)Password, then a second prompt for the codeDevices that support the RADIUS Access-Challenge, which is most modern routers, switches and firewalls over SSH
Trigger phraseType the trigger phrase (default givemeotp) as the password. This sends a code and that login fails once. Then log in again with the code as the passwordDevices or clients that cannot show a second prompt
Password onlyPassword alone. No code is sentOnly the rare device that supports neither of the above

Which setting wins

The auth flow, the code lifetime and the trigger phrase are each resolved independently. Authcha uses the most specific value that is set, in this order:

  1. The device, on the device dialog
  2. The device group, under Device Groups
  3. The vendor default, under Settings → Authentication Policy, per device type
  4. The global default, under Settings → Authentication Policy

The device dialog shows the effective value for each setting and which level it came from. Changes apply to the next login with no restart. This is the same idea as CSS: the more specific rule beats the general one.

Code lifetime and lockouts

A code stays valid for the code lifetime, 1 hour by default. While it is valid, repeated logins reuse the same code instead of sending a new one, so a user who retries does not get a flood of messages.

After three wrong passwords or three wrong codes, the user is locked out for the rest of the code lifetime. To clear a lockout sooner, run this on the Authcha host:

cd /opt/authcha
docker compose exec redis redis-cli DEL retry:<username> otp_retry:<username>

Captive portals use a simpler path

Visitors and staff signing in to a captive portal (pfSense and similar) use a different, simpler path. Add the gateway as a device of type Captive portal / hotspot (PAP) and create users of type network-user. No code, no mobile number, no jump server and no privilege mapping are involved. The Guest and portals track covers this.

LabHands-on

  1. Open Devices on the demo (viewer login demo-viewer, password Authcha-View-2026). Open a device and look at the Auth flow field and the effective values it shows.
  2. Open Settings and find Authentication Policy. Note the global default and any vendor defaults.
  3. Open Device Groups and see whether a group overrides anything.
  4. On your own install, pick a test device. Set its auth flow to Trigger phrase and its trigger phrase to something else. Confirm that the device dialog now shows the value as coming from the device.
  5. Clear the device's value and confirm it falls back to the next level up.
  6. Deliberately type a wrong password three times for a test user. Confirm the lockout, then clear it with the command above.

Check yourselfQuiz

1A device cannot show a second prompt. Which flow fits?
2The global default flow is Challenge. A vendor default says Trigger phrase for mikrotik. One MikroTik device has no setting of its own. Which flow does it use?
3Where can Password only be set?
4How many wrong passwords or codes lock a user out?
5Where is a password-only login recorded?

Cheat sheetKeep this

  • Flows: Challenge (default), Trigger phrase (givemeotp), Password only (device-level only).
  • Resolution order: device, group, vendor default, global default. Each setting is resolved separately.
  • A code is valid 1 hour by default and reused while valid.
  • Lockout: 3 wrong passwords or codes. Clear with redis-cli DEL retry:<user> otp_retry:<user>.
  • Captive portals: device type Captive portal / hotspot (PAP), users of type network-user.
  • Read more: Getting started.