Network Portal Detection redirect after Login

10287 views
Skip to first unread message

Paul Schlacter

unread,
Jul 23, 2013, 11:05:15 AM7/23/13
to android-...@googlegroups.com
Hi,

Android uses a Network Portal detection using the URL http://clients3.google.com/generate_204. This will return a 204 HTTP response without content when requesting it from the actual Google servers. Captive Portals/Network Portals will return something else (usually a splash page) and keep the requested page URL somewhere in their database. The Android device notices it and shows a notification that this wireless network needs authentication. Pressing this notification will open a browser with the splash page (just by requesting the http://clients3.google.com/generate_204 again). The user can now use some kind of form (e.g. a button) to enter the network. Usually, you will get automatically forwarded by the Network Portal/Captive Portal to the URL you've requested in the first place.

Now here comes the problem:  http://clients3.google.com/generate_204 is a "no content and don't refresh the website view" website. So pressing enter will look to the user like he did not press the "Enter" button or the request failed. This is not really nice and frustrates the user. An obvious way to "fix" it, would be a redirect to another site (e.g. apple.com) when the user pressed enter and was accepted by the Captive Portal/Network Portal. But I am quite sure Android users don't want to get sent to apple.com

What is the recommended way to handle this? Is there some kind of side channel to inform the Android device that is not logged in? Would this automatically close the tab/browser with the splash page? Would it show some other nice "now you are logged it" thing? Should this "just forward the user to another website when http://clients3.google.com/generate_204/http://www.google.com/blank.html was requested" always be used?

Paul Schlacter

unread,
Aug 11, 2013, 1:00:39 PM8/11/13
to android-...@googlegroups.com
*bump*

Anyone any idea or maybe some hint who I can ask about such information?

Paul Schlacter

unread,
Aug 16, 2013, 6:40:11 AM8/16/13
to android-...@googlegroups.com, ishe...@google.com, il...@google.com, jsha...@android.com, rgree...@google.com, wi...@google.com, yuhao...@google.com
Maybe the authors of the code can answer my question: 

Irfan Sheriff
Isaac Levy
Jeff Sharkey
Robert Greenwalt
Wink Saville
Yuhao Zheng

Isaac Levy

unread,
Aug 16, 2013, 8:28:12 AM8/16/13
to Paul Schlacter, android-...@googlegroups.com, Irfan Sheriff, jsha...@android.com, Robert Greenwalt, Wink Saville, yuhao...@google.com
Hi Paul,

This was a couple years ago, but I here's what I recall:
Some captive portals cannot intercept https pages, so to work universally the intent needs to launch an http page.  While google.com might at first seem to be an improvement, this would mean android was regularly launching an insecure google search url, which is not best practice.  generate_204 can take quite a lot of traffic, is neutral, and gives users a chance to detect an MITM ("Wasn't this supposed to be blank?").  An indicator of success is the connectivity icon in the status bar, but I agree also seeing a blank page (depending on your browser) might not be intuitive.

As far as closing the page -- this intent simply launches a URL -- it does not track the progress.  An alternative implementation might be to launch a dedicated webview and close when connectivity manager reports success.  Feel free to file a bug about that (I no longer work on Android, however).  Good luck!

Regards,
Isaac

Isaac

Paul Schlacter

unread,
Aug 18, 2013, 2:25:53 AM8/18/13
to android-...@googlegroups.com, Paul Schlacter, Irfan Sheriff, jsha...@android.com, Robert Greenwalt, Wink Saville, yuhao...@google.com
Am Freitag, 16. August 2013 14:28:12 UTC+2 schrieb Isaac Levy:
While google.com might at first seem to be an improvement, this would mean android was regularly launching an insecure google search url, which is not best practice.  generate_204 can take quite a lot of traffic, is neutral, and gives users a chance to detect an MITM ("Wasn't this supposed to be blank?").

This information is partially wrong. 204 is not "blank page" but a "no content and don't change the document view" return code. So you would see a splash page, get redirected to the 204 page and then still see the splash page. 

Дмитрий Захарченко

unread,
Feb 26, 2016, 8:14:57 PM2/26/16
to android-platform, schlacte...@gmail.com, ishe...@google.com, jsha...@android.com, rgree...@google.com, wi...@google.com, yuhao...@google.com
Hi all!

So is there a proper way to fix such a behavior? Maybe some patch? I've read too much complaints from Samsung devices owners but there is no answer suitable for me.

Thanks

воскресенье, 18 августа 2013 г., 9:25:53 UTC+3 пользователь Paul Schlacter написал:
Reply all
Reply to author
Forward
0 new messages