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

    Captive Portal authentication from mysql

    Scheduled Pinned Locked Moved Captive Portal
    11 Posts 5 Posters 3.1k 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.
    • L
      luigel
      last edited by

      We are making a project that the usernames and passwords for captive portal is from mysql database that is online. How can I authenticate the users we are searching and googling for the answers but no luck. Maybe someone can help us  :( Thank you Guys

      1 Reply Last reply Reply Quote 0
      • C
        cmb
        last edited by

        There is no way to authenticate directly to MySQL, but FreeRADIUS can use a MySQL back end and you can auth captive portal to RADIUS.

        1 Reply Last reply Reply Quote 0
        • L
          luigel
          last edited by

          Yes we will use RADIUS but the problem is that how can we authenticate users from database like mysql? Is there a way can we do this? thank you for the reply

          1 Reply Last reply Reply Quote 0
          • GertjanG
            Gertjan
            last edited by

            @luigel:

            Yes we will use RADIUS ….

            You are aware that Radius (can) use(s) MySQL ?

            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
            • M
              muswellhillbilly
              last edited by

              To save you a ton of coding (and from re-inventing the wheel in so doing)…

              http://www.daloradius.com/

              1 Reply Last reply Reply Quote 0
              • GertjanG
                Gertjan
                last edited by

                @luigel:

                We are making a project that the usernames and passwords for captive portal is from mysql database that is online. ….

                I just remember something.
                Years ago, when the PHP MYSQL client was 'integrated'' by default in the PHP that pfSense was using, I added a couple of lines to the captive portal so it would check against a MySQL server (our hotel room managing system) before the client could logging.
                From what I remember, this wasn't a "project", but more a "write up some PHP lines and done" solution.

                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
                • L
                  luigel
                  last edited by

                  @Gertjan:

                  @luigel:

                  We are making a project that the usernames and passwords for captive portal is from mysql database that is online. ….

                  I just remember something.
                  Years ago, when the PHP MYSQL client was 'integrated'' by default in the PHP that pfSense was using, I added a couple of lines to the captive portal so it would check against a MySQL server (our hotel room managing system) before the client could logging.
                  From what I remember, this wasn't a "project", but more a "write up some PHP lines and done" solution.

                  Is PHP MYSQL client already installed in pfSense or we still need to install it to pfSense? You said checking against a MYSQL server before logging in is possible, how will it be implemented using PHP, MySQL and FreeRadius? and btw thanks for the reply, it is greatly appreciated. :)

                  1 Reply Last reply Reply Quote 0
                  • GertjanG
                    Gertjan
                    last edited by

                    Well, back then, the PHP extension 'MySQL' was easy to activate, so all PHP's MySQL function commands were accessible.
                    After that, it's very easy to connect to a MySQL database, do a query on a table (or more tables) and parse the result.

                    Some recent thread on this forum show you how to activate MySQL on recent pfSense versions.
                    All this means that you modify some what the pfSense GUI …..

                    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
                    • L
                      luigel
                      last edited by

                      @Gertjan:

                      Well, back then, the PHP extension 'MySQL' was easy to activate, so all PHP's MySQL function commands were accessible.
                      After that, it's very easy to connect to a MySQL database, do a query on a table (or more tables) and parse the result.

                      Some recent thread on this forum show you how to activate MySQL on recent pfSense versions.
                      All this means that you modify some what the pfSense GUI …..

                      Thank you sir. We'll see what we can do today that we have idea for the php mysql thing. Can we contact you when we need help here in pfsense? Thanks

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

                        @Gertjan:

                        @luigel:

                        We are making a project that the usernames and passwords for captive portal is from mysql database that is online. ….

                        I just remember something.
                        Years ago, when the PHP MYSQL client was 'integrated'' by default in the PHP that pfSense was using, I added a couple of lines to the captive portal so it would check against a MySQL server (our hotel room managing system) before the client could logging.
                        From what I remember, this wasn't a "project", but more a "write up some PHP lines and done" solution.

                        Hi kindly give a sample php where the captive portal will authenticate using an existing MySQL Database.

                        Thanks in advance

                        1 Reply Last reply Reply Quote 0
                        • GertjanG
                          Gertjan
                          last edited by

                          @AYSMAN:

                          give a sample php where the captive portal will authenticate using an existing MySQL Database.

                          This was -years- ago.
                          And of course, I'm not such an approach anymore.

                          So, first : activate MySQL in the PHP setup (your call).
                          Then : understand where to add the "couple of lines" (some insight knowledge about how the captive portal auth is done).
                          Then : know how to connect to a MySQL database.
                          Know how to extract some data from a database -> table - and close the database.
                          If there was ONE matching result, then grant access.

                          Understand : you're are asking to patch the pfSense code (no problem, it can be done) - in that case YOU should be able to read that code, and why you are patching. The final phase : write up and test the patch is just a formality.

                          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
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.