Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create WiFi popup login page

Tags:

iphone

wifi

When I go to a place with a WiFi hotspot (such as Panera Bread) and connect with my iPhone, the hotspot login page appears as a popup. That is, no matter what app I'm running or what web page I'm on, the login page scrolls up from the bottom, asks for my login credentials, and then disappears.

But at some other hotspots, I don't get the login page until I go to Safari and try to load a web page.

What is the iPhone looking for that causes it to pop up the login page at some hotspots and not others? Is there a special HTML meta tag? Or is it related to the way the redirect is implemented?

like image 980
Barry Brown Avatar asked Sep 01 '10 05:09

Barry Brown


People also ask

How do you make a captive portal Wi-Fi?

Click Wireless > Settings. Click the pencil symbol to the right of the SSID that you want to edit. Click Enable Captive Portal. If you want to redirect users to a website after they view the captive portal, click the Redirect URL slider and enter a redirect URL in the Redirect URL field.

How do I trigger a Wi-Fi login on my Iphone?

Tap Settings > Wi-Fi. Tap the name of the network, then wait for a login screen to appear. Or tap next to the network's name, then tap Join Network. If prompted, enter a user name and password, enter an email address, or acknowledge terms and conditions.

How do I trigger a Wi-Fi login page on Mac?

The simplest way to forcibly reopen a captive portal wi-fi login page is to go to the following URL in Safari on your device: Go to http://captive.apple.com/hotspot-detect.html in Safari. This should immediately find the captive portal and force it to open.


2 Answers

I managed to find out the correct term for this authentication type: "Captive portal". Punching in Captive Portal iPhone into Google turned out a few technical details from these pages: one, two, three.

To implement a Wi-Fi popup login page:

  1. DNS request for www.apple.com must not fail
  2. HTTP request for http://www.apple.com/library/test/success.html with special user agent CaptiveNetworkSupport/1.0 wispr must not return Success.

I have not tested this, but it sounds about right.


Comments below mention that iOS 7 behaves differently and may query more than one server. I have not tested this. So easiest would be to simply redirect all HTTP communication to your login page, and block all non-HTTP communication.

Microsoft's captive portal detection uses something similar to pre-iOS7 behavior: its Network Connectivity Status Indicator attempts to contact http://www.msftncsi.com. Windows 8 and 8.1 also include support for WISPr.

Android's captive portal detection, as of AOSP 4.0.1, tries to contact http://clients3.google.com/generate_204 or http://www.google.com/blank.html.

So to be as universal as possible, you'll want to simply block all communication except for authentication, and include WISPr support on the login page.

I'd say "go with a proper authentication on your network" -- something universal such as PEAP+MSCHAPv2 -- but Windows makes it very painful for your users to set it up. I don't know who thought that "Use your Windows authentication details" makes a sane default on machines that are not part of a corporate domain network, or even why "Check certificate validity" is a sane default, as most networks will not consider getting a proper certificate a priority.

like image 113
Ivan Vučica Avatar answered Sep 29 '22 12:09

Ivan Vučica


iOS 6 has apparently fixed WPA2 EAP as it's suddenly popping the login window now.

Our companies public WiFi requires accepting the terms regarding monitoring, etc. I always had to manually open Safari on iPhone or iPad and navigate somewhere, it redirects to an internal acceptance page and when you clicked the Accept button it would go where you originally were headed.

Today, I updated to iOS 6 and was plesantly surprised to see the Login window slide up from the bottom and allow me to click the Accept button without even opening Safari.

like image 45
James Brickley Avatar answered Sep 29 '22 13:09

James Brickley