Redirect URL
-
Pfsense features :
Pfsense community edtion V 2.6.0-RELEASECaptive Portal :
Enable
Interfaces : Wifi
Enable Logout popup Windows
Pre-authentication : https://www.google.com
After authentication : https://www.google.com
Concurrent user logins : Multiple
Mac Filtering Disable
Authentication : Don't authenticate userHello to all,
I have a request from a customer who wants that when users connect to his network, they are redirected to the URL of his website.
I proposed him the solution of the captive portal with Pfsense, I connect to my wifi network I log then I am well redirected on my web browser with IOS or Windows, on Android I log then the redirection starts but closes immediately I am well connected to the network but the chosen web page does not stay.
I saw the post of another colleague who indicated the same problem, in pfsense is there another way than the captive portal to reproduce this behavior, namely the user connects to my network and is automatically redirected to a URL of my choice?
Thanks in advance for your help.
Translated with www.DeepL.com/Translator (free version)
-
@axel-1 said in Redirect URL:
Enable Logout popup Windows
Don't use this option.
Must users (their browser) will not allow popups any way.@axel-1 said in Redirect URL:
Pre-authentication : https://www.google.com
Make it empty, as only :
After authentication : https://www.google.com
This is the one you need. You can change https://www.google.com for anything you need.
@axel-1 said in Redirect URL:
Authentication : Don't authenticate user
I advise you to use a modified html page doesn't ask for a user or password, as you are not authenticating anyway.
As a model, take the one your user is showing right now.
Remove lines that handle user and password info, typically :<input name="auth_user" type="text"> <input name="auth_pass" type="password">
I didn't enter any info, I went straight for the button "Connect".
I was connected.
@axel-1 said in Redirect URL:
Mac Filtering Disable
You mean :
Do not check this box.
A captive portal needs an IP and a MAC.@axel-1 said in Redirect URL:
I log then the redirection starts but closes immediately
A browser windows will not close itself. The user is doing that.
@axel-1 said in Redirect URL:
I am well connected to the network but the chosen web page does not stay
At that moment, as you can see in the pfSense Captive portal status page, the user (IP + MAC) is connected.
The user can now start a a web bowser, an email client, SSH, update his system, start a VPN, whatever. -
Hello GERTJAN,
Thank you for these predictions,
The real problem comes from ANDROID, since the beginning everything works correctly on IOS and WINDOWS, but not on Android.
Here are the screen shots of the behavior I notice on ANDROID.1- On my phone I click on the name of my Wifi "Wifi_client".
2- I arrive on my personalized page of connection to the captive portal but not in my phone browser but it looks like a system page of Android.
3- I log in and connect with the submit button. At this moment I order to see the google.fr page and the system page closes I have access to internet, except that I would like the user to stay on the google.fr page. (On the picture you can see that the redirection starts and sends me back to my wifi configuration page)On IPHONE the request opens in SAFARI so I stay well on the page google.fr and on PC Windows when I click it on my network it opens in a new tab so my redirection works correctly I stay also on google.fr
-
I never had an non-iPhone in my hands, so I can confirm only that iPhone's behavior works.
What I discovered a long time ago, is that iPhone doesn't open a 'default' browser, as it was only Safari back then, but further more that the navigator used by the iOS had less functionalities as the normal Safari browser.
For example, I could not send any cookies, they would not persist on the iPhone up until the next connection.What I presume : your OtherPhone does the same thing : it launches a special browser, meant to login into the captive portal.
Your phone is clearly captive portal aware :Is it a big deal that it closes as soon as it's job is done ?
I understand, you want the browser to stay open, but that's a 'phone' behavior, and not pfSense related. Check the phone settings, if changes can be made. -
Or indeed with other Android phones the result remains the same.
Thanks for your help.That's why at the beginning of my post I was wondering if there was another method other than the captive portal to achieve this result.
-
I made an error : when I connect my iPhone, I have to enter credentials.
Then, as I redirect to https://www.google.com - and this site makes use of cookies (understatement ;) ), which are not present in my 'captive portal browser' (it doesn't keep trace of any sessions & cookies ), so Google balsts a huge popup and will ask to agree with their conditions. No need to confirm as the browser session / cookies will get ditched anyway.
In the upper left corner, there is an ok button, this buttons closes the 'captive portal browser'.I have to launch a real browser to tart navigating.
Actually, your - non iPhone - issue is actually a feature : you don't have to close this 'useless' browser, it's done for you.
-
@axel-1 said in Redirect URL:
if there was another method other than the captive portal to achieve this result.
Redirect to a locally hosted (on pfSense) web page that states :
Please close this windows / app.
You are now connected.
Use any app, like mail client, SSH, VPN, Web browser at you wish.