Captive Portal not redirected after successful login
-
Re: Captive Portal redirect does not work for a few clients
I had the same issue early this year and had to delete the Captive Portal Zone which solved the problem for most of my clients. But I have a few who will experience the same problem from time to time. My portal is user-based. Some of my clients can redirect to the portal but after logging in nothing happens, they are supposed to redirect to a website after a successful login.
-
Using what pfSense version ?
In the other thread, I suggested using a recent one.
This time : the official 2.7.0 is out, as is 23.05.1, which I'm using since.redirecting of a http request (not https !!) is :
The web browser asks a page. It gets back a "301" = redirect - answer, so it follows it.
Be aware that a http request can get redirected to a https request - and not the other way around.I advise you to check here : Status > System Logs > System > GUI Service
Check the offending devices.
Note down their brand, OS and OS version. I'm pretty sure you will see a trendBtw : I'm seeing, at max, 20 connected users on my portal (a hotel).
Surely not "400". I'm not surprised that among your "400" there will always be some device that just can't connect, or not get redirected, or whatever.
For example, I talked to the guy who installed the captive portal in the local McDonald's. According to him, it's totally fine that "some clients" can't connect to their portal, while most others can. They maintain a list with devices that "just can't", and they will not assist or try to help the local manager to assist these clients, as that is not their job.
They use the same usage politics as I do : "If you can use the free wifi, then that is great for you. If you can't, as it is a free service : then that's not great for you".
Most often, when resetting the device (network) parameters to 'default' will make them work again, as most phone constrictor (actually : the OS - and maybe some 'anti virus' or 'firewall' apps). -
@Gertjan said in Captive Portal not redirected after successful login:
Using what pfSense version ?
I'm using the latest version. Most of the time I will know when a user cannot login since the background image and the logo are broken or not loaded properly on the screen. I'm not sure what really is wrong with the system but here is a screen of the logs.
-
@Chooks said in Captive Portal not redirected after successful login:
I'm using the latest version.
23.05.1 ?
This :
looks like the OS - or program - knows or suspects that the device hasn't a direct Internet connection.
It's part of the portal detection.
Normally, the GET (www.example.tld)/connecttest.txt should return a 'page' like this one that shows the word (for example) "Success.".
If it doesn't, because another page came back : the pfsene captive portal login page, the OS should pop up a message, notification, or even a browser directly in front of the user.
If it doesn't do that ... well ...After successful portal login :
192.168.2.6 - - [07/Jul/2023:08:19:56 +0200] "POST /index.php?zone=cpzone1 HTTP/2.0" 302 0 "https://portal.brit-hotel-fumel.net:8003/index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
302 = Redirect.
You can also see the URL parameter "?zonecpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html" see the "http://captive.apple.com/hotspot-detect.html" :Because I've set :
I was take to https://www.google.com/
If my "After authentication Redirection URL" was empty, I would see theand that's a bit stupid.
But correct my iPhone wanted to go to that page (that page because it uses it to detect the prence of a captive portal). When the captive portal authentification was done, it will show the page. My phone is now happy : the device has a working "Internet connection".Look at /usr/local/captiveportal/index.php - that is the page PHP that shows the login page. But it does more then that. See /etc/inc/captiveportal.inc tells the whole (rather complex) story.