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

    Captive Portal auth page not working

    Scheduled Pinned Locked Moved Captive Portal
    10 Posts 2 Posters 1.8k 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.
    • C
      Calling Einstein
      last edited by

      I am using user manager and only users with CP privilege allowed and
      they aren't attached to any group

      I have default DHCP lease at 86400 on interface

      I have hard timeout on CP at 1430 or 10 minutes less

      DHCP forwarding is enabled

      Username and Password does not work, and routes to error page

      This happens with default pfsense html pages

      But, after entering credentials on default error page then allowed to internet

      When using my custom page, It goes to error page and when logging in there
      CP just loops back to error page and never allows access

      Here is the form on custom page

      The error login page has the same operation

      Thanks

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

        @Calling:

        I am using user manager and only users with CP privilege allowed and
        they aren't attached to any group ….

        ;D
        "Privileges" are attached to "Groups". Users are attached to Groups.
        Users NOT attached to any Groups have NO rights ("Privileges") declared, nothing happens, nothing works.

        Create a Group called "Whatever" or "Portal" and give this "Group" the right to visit the "captive portal", and not the other pages present in the GUI.
        Assign your users, those who should visit the captive portal, to this Group.

        Things start to work.

        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
        • C
          Calling Einstein
          last edited by

          I created a group as per instructions (please see attached)

          It still isn't working, just goes to error page and then loops
          back to error page

          It must be my page but the form looks right

          userman.JPG
          userman.JPG_thumb
          userpriv.JPG
          userpriv.JPG_thumb
          groups.JPG
          groups.JPG_thumb
          groupset.JPG
          groupset.JPG_thumb

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

            Use (first) the default, builtin portal page.
            See that is it works.
            Then put in place your own page.
            It works : good !
            It doesn't : make it work.

            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
            • C
              Calling Einstein
              last edited by

              I understand, Yes it works with default page

              Does anyone have the html cod for the default page?

              Maybe I can figure out what i am missing

              thanks

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

                @Calling:

                Does anyone have the html cod for the default page?

                Strange question.
                We all have the 'html' code for the default portal login page …..
                .... because it's built into pfSense. See image for the button.

                To get the code : use you browser, visit the portal page (login to you portal network) and have it show to you the "source code" of the page.

                @Calling:

                Maybe I can figure out what i am missing

                Compare you own home made page with the official one.

                Btw, when you paste html code here in this forum, make it readable (for humans), like this:

                
                		<title>Brit Hotel Fumel</title>
                
                <form method="post" action="$PORTAL_ACTION$">
                
                Bonjour, 
                Vous êtes sur le portail d'accès "Internet" de
                
                [Brit Hotel Fumel](http://www.brit-hotel-fumel.fr/)
                
                Veuillez saisir le numéro de votre chambre
                
                Le mot de passe ´Wifi´ est disponible à la réception, et mentionné sur la feuille " Informations " présent dans votre chambre.
                
                Pour info
                IP: $CLIENT_IP$
                MAC: $CLIENT_MAC$
                ZONE: $PORTAL_ZONE$
                
                	global $config, $cpzone;
                	if(isset($config['voucher'][$cpzone]['enable'])) {
                ?>
                
                	}
                ?>
                				</form>
                
                

                or, even better : http://pastebin.com/a5NJ3tZ0

                pfsense-cp-default.png_thumb
                pfsense-cp-default.png

                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
                • C
                  Calling Einstein
                  last edited by

                  Thanks for your help

                  I have only been working with html for less than a week (Know little to nothing)

                  But luckily can tell the difference between auth_pass and auth_password

                  Not sure how that happened but not surprised

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

                    I don't know where "auth_password" came from.
                    pfSense isn't using it. (check out /etc/inc/captiveportal.inc).
                    "auth_pass" is used.

                    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
                    • C
                      Calling Einstein
                      last edited by

                      Right, I changed it to auth_pass and it worked like a charm

                      What do you mean when you say  (check out /etc/inc/captiveportal.inc)

                      Is that some kind of shell window, how do you get to directories
                      through the webgui? in pfsense

                      Again, thanks for all your help

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

                        No need to checkout your pfSense install, you could tead this :

                        The main 'index.php' file that generates the login page (and error page) :
                        https://github.com/pfsense/pfsense/blob/RELENG_2_3_2/src/usr/local/captiveportal/index.php
                        and
                        https://github.com/pfsense/pfsense/blob/RELENG_2_3_2/src/etc/inc/captiveportal.inc

                        captiveportal.inc contains most, if not all the logic.

                        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.