I have just experienced same answer. Problem traces back to redirects and security frameworks. If you use Network-manager, here is easiest fix.
- Click the NM applet
- Choose edit connections
- Find the WiFi site where you are having trouble.
- Choose the little gear on bottom to open config editor.
- Choose tab IPv4 Settings
Find the box "Additional DNS Servers" and type in these Google DNS servers:
8.8.8.8,8.8.4.4
Or probably better 1.1.1.1, 1.0.0.1 regarding privacy:

those are 2 comma separated DNS servers that can be tried when an address is not available from the DNS server provided by login site.
- Hit the save button
After that, the login process works as the site administrator intends.
I have tested this at McDonalds and in a tire store. It works.
Why does it work? The login server offers a DNS address for a very limited name server, to get full name lookup, you need access to other name servers. 8.8.8.8 is the google name server, we have it as a "last change" lookup location on almost all of our computers.
Why is it a problem in the first place? The Ubuntu security framework is trying to protect you from security attacks that put 3rd party DNS servers in the middle of your workflow. Suppose the login server was allowed to do that. Then when you browse "nytimes.com" and give your password, then an attacker may be between you and nytimes, trying to steal your password.
I think other users here will have better technical explanation, but the manual insertion of trusted DNS servers is a solution that worked for me.