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

    captive portal url

    Scheduled Pinned Locked Moved Captive Portal
    7 Posts 4 Posters 1.4k 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.
    • Y
      youzersef
      last edited by youzersef

      Hallo everybody,

      i wrote in php a program to convert the vouchers to qrcode. But i want also the url to let the users to login directly. For exampel:

      https://172.18.1.1:8003/index.php?zone=test&auth_voucher=ySyFDUUMibt.

      this link will not do anything and i will stay in the login-page. I think that the url is wrong.
      if you have the url for http then will be better. :)
      can anybody help me
      With best regards
      youzersef

      F viktor_gV GertjanG 3 Replies Last reply Reply Quote 0
      • F
        free4 Rebel Alliance @youzersef
        last edited by free4

        @youzersef said in captive portal url:

        Hallo everybody,

        i wrote in php a program to convert the vouchers to qrcode. But i want also the url to let the users to login directly. For exampel:

        https://172.18.1.1:8003/index.php?zone=test&auth_voucher=ySyFDUUMibt.

        • you should use voucher instead of auth_voucher
        • with voucher, pfsense will pre-fill the details (and not connect the user automatically).

        For security reasons, it has been decided to not allow GET requests connect an user on the captive portal. The reason behind is that GET requests could be easly abused. When using POST, some protections (CSRF, etc...) are there to prevent that.

        More info here : https://github.com/pfsense/pfsense/pull/4326

        1 Reply Last reply Reply Quote 0
        • viktor_gV
          viktor_g Netgate @youzersef
          last edited by

          @youzersef said in captive portal url:

          https://172.18.1.1:8003/index.php?zone=test&auth_voucher=ySyFDUUMibt.

          Use redirurl
          i.e. https://172.18.1.1:8003/index.php?zone=test&redirurl=http://slackware.org&voucher=ySyFDUUMibt.

          see https://redmine.pfsense.org/issues/1984#note-10

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

            And last but not least :

            @youzersef said in captive portal url:

            https://172.18.1.1:8003/index.php?zone=........................
            ............
            if you have the url for http then will be better. :)

            if 'https' uses port 8003, then 8002 will be the 'http' version.

            With "http" you can use IP adresses.
            But 'http' is pretty dead these days. It works, but is not secure. Keep in mind that captive portals are mostly open wifi connections, so at least use 'https' so the traffic can't be intercepted == vouhcer code stoeln.

            And with 'https', you have to use a certificate that a (any) browser accepts.
            Good news : certs are free now. Use the acme pfSense package to get one.
            Ask for a wild card certificate, like "your-local-domain.tld"
            Now you can use an URL like https://portal.your-local-domain.tld:8003/...... and all will be looking 'pro' and secure.

            @youzersef said in captive portal url:

            i wrote in php a program

            Good writing starts with good reading.

            This is the file that presents the captive portal login page to the user : /usr/local/captiveportal/index.php
            Check it out, and you would have found all those $_POST[..]. (No REQUESTS)
            And the parameters that it recognizes.

            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
            • Y
              youzersef
              last edited by

              thank you everybody for your reaction. It works. The problem for https that i need ssl certificat. "LetsEncypt" for exampel need renew every 3 months and i can not do it every time for my customers and also i can not leave the port 80 open permanent to renew automatically. Or i need payment ssl but the most of customers do not want pay regularly.

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

                @youzersef you can use a TXT DNS record to perform the renewal automatically

                I'm personally doing that for my captive portal instance

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

                  @youzersef said in captive portal url:

                  The problem for https that i need ssl certificat. "LetsEncypt" for exampel need renew every 3 months and i can not do

                  The acme package will renew the cert for you - you have nothing to do.

                  @youzersef said in captive portal url:

                  and also i can not leave the port 80

                  And you're right. And you don't have to open nothing. There are far better ways.
                  You'll be needing a domain name. That will not be free. Something like 5 $ a year ?
                  But, take the time to chose the right registrar. One that is supported by acme : see here for all the details.

                  @youzersef said in captive portal url:

                  Or i need payment ssl but the ....

                  In that case you need a domain name first.
                  And you have to buy the cert every year or so == always more expensive.

                  @youzersef said in captive portal url:

                  the most of customers do not want pay regularly.

                  That's different, but I guess these people are not what I would call customers.
                  The easy way : don't work for these people.
                  most of customers do not want pay regularly.

                  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.