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

Captive Portal "Pre-authentication redirect URL" not working (BUG???)

Scheduled Pinned Locked Moved 2.1 Snapshot Feedback and Problems - RETIRED
5 Posts 2 Posters 7.6k 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.
  • E
    EOC2611P
    last edited by May 15, 2012, 9:59 AM

    It's seems that there is a problem with this field, some of the users, including me, are reporting this option to be useless right now.
    Does anybody knows if there is a way to fix it or a work around?
    Thanks!  :)

    1 Reply Last reply Reply Quote 0
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by May 15, 2012, 3:02 PM

      It works fine, there is no bug, it just requires a particular set of circumstances and some custom code on the actual captive portal page to work properly.

      I seem to recall explaining it before in the forum, but I could be wrong, try searching a bit and seeing what turns up.

      Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • E
        EOC2611P
        last edited by May 17, 2012, 6:37 PM

        @jimp:

        It works fine, there is no bug, it just requires a particular set of circumstances and some custom code on the actual captive portal page to work properly.

        I seem to recall explaining it before in the forum, but I could be wrong, try searching a bit and seeing what turns up.

        Thanks, here is the result of my search, i hope it's going to help others having the same problem right nowโ€ฆ.well, after having another look, probably that's not gonna help much, sorry, i will try harder  :D

        ![Search Result.jpg](/public/imported_attachments/1/Search Result.jpg)
        ![Search Result.jpg_thumb](/public/imported_attachments/1/Search Result.jpg_thumb)

        1 Reply Last reply Reply Quote 0
        • E
          EOC2611P
          last edited by May 17, 2012, 8:22 PM May 17, 2012, 8:19 PM

          Ok i found something here:  http://forum.pfsense.org/index.php/topic,34148.0.html

          A quick copy & past of the relevant answer
          โ€“--------------------------------------------------------------------------------------------------
          _jimp
          Administrator
          Hero Member

          Offline

          Posts: 9922

          Re: Pre-authentication redirect URL

          ยซ Reply #4 on: March 30, 2011, 11:07:05 am ยป
          โ€“------------------------------------------------------------------------------

          The pre-auth URL will do that, but you need a captive portal page that actually does the redirect to the CMS page, and the CMS server's IPs need to be added as captive portal bypass IPs or hostnames if it's on a separate subnet.

          The pre-auth URL field probably needs a better note saying it requires a special captive portal page be uploaded. You really just need a bit of code at the top of the page (it can be a .php file)

          Code:

          require("globals.inc");
          $request_uri = urldecode(str_replace("/index.php?redirurl=", "",  $_SERVER["REQUEST_URI"]));
          $portal_redirurl = urldecode("$PORTAL_REDIRURL$");
          if(!stristr(urldecode("$PORTAL_REDIRURL$"), $request_uri)) {
          Header("Location: $PORTAL_REDIRURL$");
          exit;
          }
          ?>

          That does require that your landing page on the CMS server redirect them back to the direct CP URL, http://x.x.x.x:8000/index.php - but it could be rewritten to check for a referer or some other scheme. It isn't as easy as doing a post-auth redirect to another page._

          1 Reply Last reply Reply Quote 0
          • J
            jimp Rebel Alliance Developer Netgate
            last edited by May 18, 2012, 5:33 PM

            Yeah that's the post I was talking about. That's everything you need to know about how to make it work.

            Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            5 out of 5
            • First post
              5/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received