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

    Captive portal Pre-authentication redirect URL 2.3.2-RELEASE-p1 (amd64) problem

    Scheduled Pinned Locked Moved Captive Portal
    2 Posts 2 Posters 1.9k 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.
    • S
      sonidoP
      last edited by

      My code at the top of the custom page is:
      (ref: https://doc.pfsense.org/index.php/Captive_Portal_Pre-authentication_Redirect )

      require_once("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;
      }
      ?>

      Change  require("globals.inc");  to  require_once("globals.inc");
      (ref: https://forum.pfsense.org/index.php?topic=109829.0)

      Body form:
      (ref:  Suggested in the configuration page.)

      Redirect pre-autentication work, the problem is to get the authentication form.

      Try URL:  http://x.x.x.x:8002/index.php  (change 8000 to 8002)
      (ref: https://doc.pfsense.org/index.php/Captive_Portal_Pre-authentication_Redirect ) with blank page result.

      Try URL: http://x.x.x.x:8002/index.php?zone=cp_guest
      (ref: https://forum.pfsense.org/index.php?topic=110073.30 ) with blank page result.

      There is little documentation of the Pre-authentication procedure in version 2.3.2-RELEASE-p1,
      Someone could tell me if the process is correct?
      The cp_guest zone is correct or is it another to get the authentication form?

      thanks a lot..
      (In version 2.2 this works well)

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

        @sonidoP:

        Try URL: http://x.x.x.x:8002/index.php?zone=cp_guest
        (ref: https://forum.pfsense.org/index.php?topic=110073.30 ) with blank page result.

        Like that ?
        Your captive zone 'name' in question is really "cp_guest" ?
        The port used by pfSense is really "8002" (mine is 8003 for https and 8002 for http - you can't chose them, they are assigned by pfSense when creating portals)

        If "http://x.x.x.x:8002/index.php?zone=cp_guest" doesn't work, you have two possibilities :
        You portal doesn't work -> make it work first.
        Visiting "http://x.x.x.x" (your captive portal address) should redirect you to … as said here : https://forum.pfsense.org/index.php?topic=110073.msg679281#msg679281
        Check your port number and zone name - it should be EXACT.

        @sonidoP:

        There is little documentation of the Pre-authentication procedure in version 2.3.2-RELEASE-p1,
        Someone could tell me if the process is correct?

        As said here https://doc.pfsense.org/index.php/Captive_Portal_Pre-authentication_Redirect and as you might guess, this page isn't really maintained, and rather tricky to use.

        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.