Prevent Captive Portal auto-close after authentication (Android)

好久不见. 提交于 2019-12-02 17:19:41

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.

This appears to be new Captive Portal behavior in Android devices since the release of Lollipop (5.0).

We have not yet discovered a workaround. If there is an explicit way to disable the auto-dismissal it is probably only documented in the Android codebase available here (I've been looking, but haven't found anything definitive yet):

https://android.googlesource.com/platform/frameworks/base

FYI, we've also noticed Android uses CloudFront CDN for its captive network detection. Our captive portal solution originally used CloudFront for assets, so we had to whitelist CloudFront subnets in pre-auth ACLs. Whitelisting CloudFront subsequently caused captive network detection to fail on recent Android devices. We had to abandon CloudFront CDN to restore captive portal functionality for Android devices.

Why don't you just hold captive portal opened after authentication? You can always allow access to every site except captive checking sites.

Tested and working both Android and iOS in all versions. If you need to access cookies/shared storage from default browser (not captive ios/android sandboxed browser), you gotta hop out it before authentication.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!