OPNsense Forum

English Forums => Development and Code Review => Topic started by: soernt.poppe on May 31, 2018, 09:39:09 am

Title: I would like to extend the Captive Portal...
Post by: soernt.poppe on May 31, 2018, 09:39:09 am
Hi there,

I would like to extend the Captive Portal to support this workflow:

Guest user try to connect to my network an gets displayed a QR-Code and a login button. The QR-Code contains a new random user name and password.

Guest ask an allready authenticated user to create a voucher. Authenticated users scanns the QR-Code and gets displayed a message "Create new voucher for "user name" and an imput field for the expiry time.

After the authenticated user press "Create Voucher", a voucher will be created. The Guest clicks the login button and gets validated.

I am completly new to create these kind of customization. I scanned through the source code and found the "src\opnsense\mvc\app\library\OPNsense\Auth\Voucher.php" file.

What I would like to see here:
a) a function that returns a new random user name and password.
b) a function that creates a voucher for a given user name, password and expiry time.

Basically the functions are allready there, within the generateVouchers function.

I need someone who can guide me and will perform a code review :-)

Kind regards,
Sörnt