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

    Captive Portal not redirected after successful login

    Scheduled Pinned Locked Moved Captive Portal
    captive portal
    4 Posts 2 Posters 1.2k 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
      Chooks
      last edited by

      Re: Captive Portal redirect does not work for a few clients

      I had the same issue early this year and had to delete the Captive Portal Zone which solved the problem for most of my clients. But I have a few who will experience the same problem from time to time. My portal is user-based. Some of my clients can redirect to the portal but after logging in nothing happens, they are supposed to redirect to a website after a successful login.

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

        @Chooks

        Using what pfSense version ?
        In the other thread, I suggested using a recent one.
        This time : the official 2.7.0 is out, as is 23.05.1, which I'm using since.

        redirecting of a http request (not https !!) is :
        The web browser asks a page. It gets back a "301" = redirect - answer, so it follows it.
        Be aware that a http request can get redirected to a https request - and not the other way around.

        I advise you to check here : Status > System Logs > System > GUI Service
        Check the offending devices.
        Note down their brand, OS and OS version. I'm pretty sure you will see a trend 😊

        Btw : I'm seeing, at max, 20 connected users on my portal (a hotel).
        Surely not "400". I'm not surprised that among your "400" there will always be some device that just can't connect, or not get redirected, or whatever.
        For example, I talked to the guy who installed the captive portal in the local McDonald's. According to him, it's totally fine that "some clients" can't connect to their portal, while most others can. They maintain a list with devices that "just can't", and they will not assist or try to help the local manager to assist these clients, as that is not their job.
        They use the same usage politics as I do : "If you can use the free wifi, then that is great for you. If you can't, as it is a free service : then that's not great for you".
        Most often, when resetting the device (network) parameters to 'default' will make them work again, as most phone constrictor (actually : the OS - and maybe some 'anti virus' or 'firewall' apps).

        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
          Chooks
          last edited by

          @Gertjan said in Captive Portal not redirected after successful login:

          Using what pfSense version ?

          I'm using the latest version. Most of the time I will know when a user cannot login since the background image and the logo are broken or not loaded properly on the screen. I'm not sure what really is wrong with the system but here is a screen of the logs.

          3855be2a-b7fe-45e9-b029-5dc327ee249b-image.png

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

            @Chooks said in Captive Portal not redirected after successful login:

            I'm using the latest version.

            23.05.1 ?

            This :

            3c06064e-e679-421e-b8ef-8ae0286e7c88-image.png

            looks like the OS - or program - knows or suspects that the device hasn't a direct Internet connection.
            It's part of the portal detection.
            Normally, the GET (www.example.tld)/connecttest.txt should return a 'page' like this one that shows the word (for example) "Success.".
            If it doesn't, because another page came back : the pfsene captive portal login page, the OS should pop up a message, notification, or even a browser directly in front of the user.
            If it doesn't do that ... well ...

            After successful portal login :

            d7c6be7a-64af-4e2d-88fd-3c4917acbd46-image.png

            192.168.2.6 - - [07/Jul/2023:08:19:56 +0200] "POST /index.php?zone=cpzone1 HTTP/2.0" 302 0 "https://portal.brit-hotel-fumel.net:8003/index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"

            302 = Redirect.
            You can also see the URL parameter "?zonecpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html" see the "http://captive.apple.com/hotspot-detect.html" :

            b8693d06-cfb9-4078-b69a-94e313943dd0-image.png

            Because I've set :

            9582e267-23f6-4b26-a378-ec51189fede9-image.png

            I was take to https://www.google.com/
            If my "After authentication Redirection URL" was empty, I would see the

            fd83eba8-4ed9-4cab-ab1f-c7778b48ea29-image.png

            and that's a bit stupid.
            But correct my iPhone wanted to go to that page (that page because it uses it to detect the prence of a captive portal). When the captive portal authentification was done, it will show the page. My phone is now happy : the device has a working "Internet connection".

            Look at /usr/local/captiveportal/index.php - that is the page PHP that shows the login page. But it does more then that. See /etc/inc/captiveportal.inc tells the whole (rather complex) story.

            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.