Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Captive Portal auto-close after authentication (Android)

So the simple idea is that we have a RADIUS server setup to allow users to authenticate with our Ruckus controller via user credentials. On authentication the user should be redirected to a page that allows them to manage MAC authenticated devices.

On everything we have tested so far, including "older" Android devices this seems to be no issue and things run as they should. However with Lollipop (5.0+) versions of Android the captive portal has changed quite a bit, and part of that change is to automatically close the captive portal that launches when you join the network. Because we want them to be redirected to a MAC device management page after authentication so they can add the device they currently logged in with and avoid having to log in again, this is bad.

What I have tried:

  1. Detecting if the browser is being launched in a mobile device and popping an alert in onbeforeunload that attempts to keep the browser open.

  2. Opening a new browser window, pointing to the redirection URL, when successful authentication is detected (essentially managing the redirect ourselves).

  3. Performing Option 2, and then Option 1 on the redirected URL

What won't work:

  • Asking users to disable the captive portal option on their device. Not trying to point general users to advanced controls.

  • Creating an open network to access the MAC manager, it must be behind some authentication.

Solution For Now:

We are unhappy with this solution, but for now we are simply asking users to authenticate with the network and then open their browser and go to the basic login portal page (non-network authentication) that users use to manually add devices they can't connect with (like printers, gaming devices, etc.). Though this works, it is a pain for users to have to login, open a browser, manually enter a url, and login again.

This isn't a problem that people haven't run into, see here, I just haven't been able to find a solution from anyone that has run into the problem. Certainly there is some way of utilizing javascript or something to keep the browser open in this situation. If not, anyone have any better ideas for managing things?

like image 943
zgc7009 Avatar asked Jan 21 '16 19:01

zgc7009


People also ask

How does Android detect captive portal?

Captive portals were detected using cleartext HTTP probes to known destinations (such as connectivitycheck.gstatic.com ), and if the probe received an HTTP redirect, the device assumed that the network was a captive portal.

How do I fix my captive portal login?

Close everything in your browser. If you have your startup setting “Continue where you left off”, then change it to “Open the new tab page” and open your browser again. If you don't see the captive portal come up, try going to a http:// website as they can trigger the captive portal.

What is captive portal used for?

A captive portal is a Web page that the user of a public-access network is obliged to view and interact with before access is granted. Captive portals are typically used by business centers, airports, hotel lobbies, coffee shops, and other venues that offer free Wi-Fi hot spots for Internet users.


1 Answers

We have managed to keep the UAM Browser / captive portal browser open on lollipop by adding firewall rules blocking :

  • clients3.google.com
  • clients1.google.com ,
  • android.clients.google.com
  • connectivitycheck.android.com
  • connectivitycheck.gstatic.com

Thus after the user is authenticated the UAM / Captive Browser stays open.

You can keep UAM open as long as you need, you can close it by invoking a reverse proxied 204 redirect to google's connectivity page.

like image 77
Johann Combrink Avatar answered Sep 18 '22 12:09

Johann Combrink