Your external captive portal was working, and now guests can’t get online.
The portal’s logs show an error like Login failed: Request failed with status code 499.
Status 499 isn’t a standard HTTP error. It’s what UniFi OS sends back when a login with a username and password needs a multi-factor authentication (MFA) code to finish. A captive portal running on a server has no way to type in a code, so the login fails, and so does every guest who’s waiting to be let online.
Most external portals let guests online by signing in to UniFi Network with an admin username and password, then sending it a command. That worked for years. Then Ubiquiti made MFA mandatory.
Ubiquiti’s own MFA article puts it plainly: MFA is required for everyone logging in to a UniFi device, with one exception, logging in locally with local credentials. Any portal that signs in with your UniFi account now gets asked for a code, and stops.
We maintain unifi-hotspot, an open-source external portal for UniFi, and people running it reported exactly this.
If you want to keep running your own portal, give it an account that doesn’t need MFA.
UNIFI_USER and UNIFI_PASS.Local accounts aren’t asked for MFA, so the portal can sign in again.
The trade-offs are the ones that come with any portal that signs in this way. Your console has to be reachable by the portal, which usually means it’s on the same network or you’ve forwarded a port. And you now have an admin account without MFA, so keep its password long and its access narrow.
UniFi now has an official API that uses API keys rather than usernames and passwords. API keys don’t involve MFA at all. You create one, choose what it can do, and revoke it if you ever need to.
GuestGate is a hosted portal built on that API. It connects through UniFi’s official cloud connector with an API key, so there’s no admin account, no MFA prompt and no port forwarding. UniFi captive portal without port forwarding explains how the connection works.
If you’re happy running a server, keeping the portal updated and looking after a local admin account, Fix 1 gets your self-hosted portal working again today.
If you’d rather not, GuestGate does the same job without any of that, and adds a branded login page, a guest list with marketing consent, webhooks and Zapier. It’s $15 a month for each portal, with a 14-day free trial and no card needed.