31

When the device tries to connect to an access point or router, it has to sign in on the captive portal page with the message saying

"Sign in to Wi-Fi network".

How does the access point/router identify that a sign in is required for the device and what is the process behind it?

Sagar Vaghela
  • 413
  • 1
  • 6
  • 9

3 Answers3

35

The detection url differs between different Android versions.

For Marshmallow, it uses connectivitycheck.gstatic.com/generate_204, check the code here AndroidXRef - Marshmallow 6.0.0_r1

For Kitkat, it uses clients3.google.com/generate_204 check the code AndroidXRef - KitKat 4.4.4_r1

Manu
  • 3,063
  • 7
  • 23
  • 43
RyanDH
  • 466
  • 4
  • 4
11

This technology is called "Captive portal". There are several implementations. As I know, Android tries to reach a file named generate_204 on one of the Google servers and if it is not possible, a notification in generated.

Further reading on Wikipedia: Captive_portal

Άνδρας
  • 1,123
  • 1
  • 8
  • 16
2

A captive portal is generally implemented by directing all traffic to a valid HTTP response (200). This HTTP response is what appears in the captive portal.

This can be done with tools like iptables or dnsmasq.

Jude Osborn
  • 121
  • 2