This technique is called a Captive Portal.
There actually is an RFC standard for this since 2015. This RFC extends the DHCP and IPv6 RA protocols to inform the client about the URL of the captive portal as soon as it connects to the network. But this method is not yet very widely used. I am not even sure how widely it is supported by end devices (it would need support from both the operating system and the web browser). The usual procedure is to do it with a HTTP redirect like this:
- When you connect to the WiFi network, the router (acting as a DHCP server) gives you an IP address. But that IP address gets marked as "unauthenticated" by the router.
- When an "unauthenticated" IP address makes a http or https request to an external website, that request gets intercepted. The router replies with a redirect to the login page. Depending on your browser's security settings, this might generate the "Your connection is not secure" error on HTTPS requests, because the reply doesn't come from the website it is supposed to come from.
- When you enter your login credentials, your IP address gets marked as "authenticated" and can now access websites normally.
The "You must log in to the network" below the address bar is a special feature of Firefox called "Captive Portal Detection". It works by requesting the URL
http://detectportal.firefox.com/success.txt and comparing the response with the expected one. If the browser receives a redirect or a login form instead, it assumes that the user is blocked by a captive portal.
Are there any software or configuration which can skip user name/password prompt and authenticate automatically under windows or android
I don't know any, but if you use the same wifi regularly, then you could do it with a little shell script which uses
wget to POST your login credentials directly to the captive portal URL. But you would need to write this specifically for each network, because the login URL and the POST fields will be different.