Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Captive portal with external database

    Scheduled Pinned Locked Moved Captive Portal
    9 Posts 4 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      moelharrak
      last edited by

      Hi,
      Is it possible to configure captive portal to work with External Database,
      to use another authentication form (i.e; Room and Name).

      F A 2 Replies Last reply Reply Quote 0
      • F
        free4 Rebel Alliance @moelharrak
        last edited by

        @moelharrak hi

        Yes : You could set up an external radius server (such as freeradius), which itself would rely on a database for authenticating users.

        1 Reply Last reply Reply Quote 0
        • M
          moelharrak
          last edited by

          Thank you for your reply ,I don't want to use RADIUS , is that possible ?

          GertjanG F 2 Replies Last reply Reply Quote 0
          • GertjanG
            Gertjan @moelharrak
            last edited by Gertjan

            @moelharrak said in Captive portal with external database:

            I don't want to use RADIUS

            Then there is no solution at this moment.

            Still, it is possible, and boils down to one thing : how good are your programming skills ?
            But I guess, if you were able to do so, you would already have found out pfSense can use the build in data base, or an external database, through FreeRadius package. All this is explained in the Manual.
            Up to you to code against any type of database you want. You will be you're own limitation.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            • F
              free4 Rebel Alliance @moelharrak
              last edited by

              @moelharrak no. It's curently not posdible

              But i don't understand why that would be needed.
              Radius is an authentication server, it's really designed to perform the job...

              1 Reply Last reply Reply Quote 0
              • M
                moelharrak
                last edited by

                I'm just asking if there is a limit with pfsense or it's open source and as you said depending to our own limitation.
                I'm just asking if it's possible and the dev team will do that:

                • As a first step connect the portal to and external database.
                • Second connect the database to a PMS and informations that come from PMS like (Name/Room number/ checkout data,...) will be stored in the database and use it as authentication.
                GertjanG 1 Reply Last reply Reply Quote 0
                • GertjanG
                  Gertjan @moelharrak
                  last edited by Gertjan

                  You said it :

                  @moelharrak said in Captive portal with external database:

                  it's open source

                  this means that everybody can add whatever is needed.

                  @moelharrak said in Captive portal with external database:

                  the dev team will do that

                  Thousands will have to ask for a new possibility, and they'll code it up.

                  @moelharrak said in Captive portal with external database:

                  connect the database to a PMS and informations that come from PMS like (Name/Room number/ checkout data,...)

                  I've done EXACTLY that in the past.
                  As I'm using a 'PMS', and sitting right now now in what's called the reception of a hotel.
                  The database in question was a MSSQL running on an (now retired) 2008R2. The PMS in question was closed source, but the MSSQL server credentials were easy to fine.
                  With some reverse engineering, I was able to build the 'logic' that detects if a room is occupied, not checked out, and generate / assign a password. It worked pretty well.
                  All what was needed what the PHP MySQL extension and some code.

                  But, there was a but.
                  The conditions for the "Wifi-by-Hotel" access is and was : it's free **, if you "manage to connect yourself". So, it wasn't worth it to modify the pfSense source as these modifications have to be re implemented every time an pfSense update is applied.
                  As I prefer security above comfort, I decided to go for a much simpler system : the login user name is the 3 digit room number as clients can find number easily ( ;) ). The password is shown in the Room directory in the room (before Co..19 days) . I actually show the password now on the Captive portal's login page ( !!) (and still people call the reception for the password ...)

                  ** as the hotel has 4G (soon be be 5G coverage).

                  No "help me" PM's please. Use the forum, the community will thank you.
                  Edit : and where are the logs ??

                  M 1 Reply Last reply Reply Quote 1
                  • M
                    moelharrak @Gertjan
                    last edited by

                    @gertjan Thank you very much for your reply and information, That is really cool what you did. I hope we can do something with it too.

                    1 Reply Last reply Reply Quote 0
                    • A
                      AYSMAN @moelharrak
                      last edited by

                      @moelharrak Been doing this for quite a while now. pFsense Captive portal with freeradius authentication and MySQL as backend database. What I did was modified our PMS System (Hotel software that we created) to insert into the radius schema the needed information so that guest can authenticate to when connecting to the wifi. In this case I decided to use the Room number as the username and the last name of the guest as the password.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.