You need to authenticate to gain access to the network itself, not just the resource. This is what you see on captive portals like hotel or airport WiFi.
A user connects to airport WiFi and gets redirected to a login page before they can browse the internet.
Check how any URL responds in real time