authcha learn

Learn / Guest and portals

Phones, laptops and the sign-in window

Module 5 of 5 · 20 minutes

By the end you can

  • Describe how a device discovers a captive portal and when its sign-in window closes
  • Name the probe addresses the gateway must handle
  • Explain the design rules that keep the portal working in a sign-in mini-browser
  • Predict the effect of a private Wi-Fi address on vouchers and MAB

How a device meets the portal

  1. The device joins the Wi-Fi and asks a probe address.
  2. The gateway intercepts the probe and answers with a redirect to the portal.
  3. The operating system shows its sign-in window, a mini-browser, or a notification. The person signs in and the portal sends the browser on.
  4. The gateway lets the client through. The next probe gets its genuine answer, and the system closes the window and marks the network online.

Steps 2 and 4 are the gateway's job. Authcha's part is the page in step 3 and the helper pages it links to.

The probes

The gateway must intercept these before sign-in and answer genuinely after:

ProbeGenuine answer
captive.apple.com/hotspot-detect.htmlSuccess page
connectivitycheck.gstatic.com/generate_204 and similarHTTP 204, no body
www.msftconnecttest.com/connecttest.txtMicrosoft Connect Test
detectportal.firefox.com/success.txtsuccess
nmcheck.gnome.org/check_network_status.txtNetworkManager is online

pfSense's captive portal does this itself. Authcha does not answer probes, because they go to other hosts. It only has to avoid breaking them. If a phone keeps saying "no internet" after a good login, check the zone's allowed hostnames and that the gateway passes the probe through once the client is admitted.

The operating systems

SystemHow the window appearsWhat to remember
iOS and macOSThe Captive Network Assistant mini-browser opens when the probe is not answered SuccessNo pop-ups, cookies may be sandboxed, no downloads. Private Wi-Fi Address is on by default
AndroidA "Sign in to Wi-Fi network" notification opens a WebViewOld WebViews (Android 7) understand only old JavaScript. Randomised MAC per network is on by default from Android 10
Windows 10 and 11The system opens the default browser or an Edge-based windowA normal browser. HTTPS to the portal needs a trusted certificate or it warns
Linux and ChromeOSA notification offers to open a browserA normal browser

Why the pages are built the way they are

The sign-in windows are limited browsers. The generated pages use nothing they are known to lack:

RuleWhy
No pop-ups, no new windowsThe sign-in windows cannot open them, so every step stays in the same view
No cookies and no browser storageStorage may be empty or blocked. Form protection is a signed, address-bound token in the form
No file downloadsMini-browsers cannot download
No outside requestsBefore sign-in the client reaches only the walled garden, so style, script and the logo are inline
Works without JavaScriptEvery action is a plain form post or link. Script only adds friendliness
Old-browser JavaScript onlyiOS 12 Safari and Android 7 WebView must parse it
Relative units and system fontsText scaling to 200% and right-to-left languages work without a sideways scrollbar

Native "Sign in" with RFC 8908

Authcha can answer the Captive Portal API at https://<console>/p/<gateway>/capport. Advertise it with DHCP option 114 (and the Router Advertisement option for IPv6), allow the console in the walled garden and use a trusted certificate. Phones that implement it then show a native "Sign in" button and the time and data left. It is optional, and the redirect flow keeps working without it. It was not verified on a device.

Private Wi-Fi addresses

iOS, Android and Windows use a different MAC address per network, and some rotate it. The consequences:

  • Sessions are keyed by client IP, so a rotating MAC does not confuse the status page or session control.
  • Vouchers are tied to the MAC the device presented when it redeemed. If the address changes, the device is a new one: the portal asks for the voucher again, and the voucher's device count includes the old address. An administrator can revoke it and issue a new one.
  • MAB entries for known devices need a stable address. Turn private addressing off for that network on managed devices, or use 802.1X.

The only place a changing address costs anything is the per-voucher device limit.

LabHands-on

  1. Open the phones and laptops guide and find the "Not verified" list for your operating systems.
  2. On a phone, connect to a captive network (the demo has none, so use your lab pfSense or a hotel network) and watch the sign-in window open and close.
  3. Check Private Wi-Fi Address on an iPhone or Wi-Fi privacy on an Android phone for your lab network. Redeem a voucher, then change the setting and reconnect. What happens?
  4. On a Linux laptop in the guest network, run curl -i http://detectportal.firefox.com/success.txt before and after sign-in. Compare the answers.
  5. List the five probe addresses from memory.

Check yourselfQuiz

1Which system answers the connectivity probe after sign-in?
2Why do the portal pages avoid cookies and local storage?
3A voucher was redeemed on a phone with a private Wi-Fi address. The address rotates. What happens next?
4What does DHCP option 114 do?
5What do the guides say about the real sign-in assistants?

Cheat sheetKeep this

  • Flow: probe, redirect, sign-in window, admit, genuine probe answer, window closes.
  • Gateway handles probes. Authcha does not.
  • Portal pages: no pop-ups, no cookies or storage, no downloads, no outside requests, work without JavaScript.
  • Private Wi-Fi address breaks voucher and MAB matching. Turn it off, or use 802.1X.
  • RFC 8908: https://<console>/p/<gateway>/capport and DHCP option 114 (optional, unverified on a device).
  • Read more: Captive portal: phones, laptops and assistants.