@ciidfrance said in Wrong captive portal login page redirection:
And add https://www.google.com url redirection after login but no redirection appear after login
pfSense 2.5.0 - right ??
Strange, as I'm using :
39524145-18fd-4bc4-aabc-b01a48a406e1-image.png
for years now.
It works ™
Btw : you uploaded your own "captive portal login page" ?
If so, what happens when you use the default, build in page ?
edit : oops.
I'm not using the build in User manager, but FreeRadius to identify users.
Using the local user manager, I'm not seeing "You are connected".
But "Succes".
Because (the logs tells a lot : Status > System Logs > System > GUI Service) I'm using a iPhone, and when connected to a Wifi network, it (the iPhone OS) throws out a test request over http (not https) to : http://captive.apple.com/hotspot-detect.htm
192.168.2.102 - - [10/Mar/2021:09:06:55 +0100] "POST /index.php?zone=cpzone1 HTTP/2.0" 302 0 "https://portal.local.net:8003/index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
I'll inspect this situation somewhat later on.
It does remind me of an identical issue that happens a year (or so ,) ago.
You'll find references - and a possible solution for it - in the forum.
edit :
The message
You are connected.
Is shown when, according the code :
/* If client try to access captive portal page while already connected,
but no custom logout page does exist and logout popup is disabled */
edit 2 :
At this line :
https://github.com/pfsense/pfsense/blob/0d8a927099acaa50479c2616265541bdeb6c27a9/src/usr/local/captiveportal/index.php#L110
Line 110 :
Paste this :
if (!empty($cpcfg['redirurl'])) {
/* 2021-03-11 https://forum.netgate.com/topic/161673/wrong-captive-portal-login-page-redirection/10
According the GUI :
"After authentication Redirection URL - Set a forced redirection URL.
Clients will be redirected to this URL instead of the one they initially
tried to access after they've authenticated. */
log_error("Zone: {$cpzone} - Captive portal : redirurl = {$orig_request}");
$redirurl = $cpcfg['redirurl'];
}
It's a workaround.
The test is taken just a couple of lines above.
It's the third one that assigns the $redirurl in the GUI.
But if your browser was using a 'test http request' to detect the portal, it's this one that takes precedence : the second test - and that one nearly always 'wins'.
At least, for the Apple family, it does.
Sorry, can get my hand s on a samsung