title: Prevent Captive Portal auto-close after authentication (Android)
body: <p>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.</p>
  
  <p>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.</p>
  
  <p><strong>What I have tried:</strong></p>
  
  <ol>
  <li><p>Detecting if the browser is being launched in a mobile device and popping an alert in <em>onbeforeunload</em> that attempts to keep the browser open.</p></li>
  <li><p>Opening a new browser window, pointing to the redirection URL, when successful authentication is detected (essentially managing the redirect ourselves).</p></li>
  <li><p>Performing Option 2, and then Option 1 on the redirected URL</p></li>
  </ol>
  
  <p><strong>What won't work:</strong></p>
  
  <ul>
  <li><p>Asking users to disable the captive portal option on their device. Not trying to point general users to advanced controls.</p></li>
  <li><p>Creating an open network to access the MAC manager, it must be behind some authentication.</p></li>
  </ul>
  
  <p><strong>Solution For Now:</strong></p>
  
  <p>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. </p>
  
  <p>This isn't a problem that people haven't run into, <a href="http://forum.mikrotik.com/viewtopic.php?t=102180">see here</a>, 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?</p>