Is voucher in url still available?
-
Hi,
I want to distribute the vouchers by qrcode which will contain a url like thishttp://pfsenseip:8002/index.php?zone=zone_name&redirurl=redir_url&voucher=voucher_code
but it returns me directly to the authentication page. I read on the forum but I did not understand if it's working or if the voucher by GET has been disabled.
https://redmine.pfsense.org/issues/1984 -
I created a QR using
https://portal.my-portal.tld:8003/index.php?zone=cpzone1&redirurl=https://www.google.com&voucher=wB8C8Usq33Qwhere "portal.my-portal.tld" is of course my real valid captive portal domain name.
wB8C8Usq33Q was valid.The voucher pre filled in as you can see, I had to tap 'Login' to login.
Btw : I'm using 23.01 - and the latest pfSense System_Patches package version 2.2.2.
-
@gertjan
Hi,
I'm using 2.6.0-RELEASE (amd64)
built on Mon Jan 31 19:57:53 UTC 2022
FreeBSD 12.3-STABLEMay be it doesn't work with this version.
I had to change my Portal page contents in order to read the $_GET['voucher'] variable and if there's an error in Auth error page contents I had to read $_POST['auth_voucher'].
It works with these changes but I still don't know if $_GET['voucher'] is originally read by the authentification default pages. -
@kabeda said in Is voucher in url still available?:
I still don't know
So you know what you're looking for.
$_GET['voucher']
Open source ... heard about that one ?
So, go here : https://github.com/pfsense/pfsense/tree/RELENG_2_6_0Then click you way to /src/usr/local/captiveportal/index.php
Look for, search, Ctrl-f "$_GET['voucher']" on that page.
It's thereNext test : on your pfSense, you have the console access.
Use it.
Use option 8.grep "GET\['voucher'\]" /usr/local/captiveportal/index.php
You'll find the same thing.
Btw : when you use vouchers, it's important that you have this https://github.com/pfsense/pfsense/blob/master/src/etc/inc/captiveportal.inc#L156 in your own portal (html) page.
You can add PHP into your html portal page.