I've been looking in to how to resolve this issue. Here's what I did:
Set the portal page to anything you like, but make sure it includes:
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;
}
Set your pre-auth url to point to your external web server
Web server loads its page (for me a data capture page), and posts to a database and echo's header location to authenticate.php
Authenticate.php is essentially the default captive portal code, but I modified $PORTAL_??$ variables to be hard coded. This is then posted directly to the firewall (192.168.1.1:8002/index.php?zone=[zonename]), and the user is then forwarded to the $PORTAL_REDIRURL$
The user is authenticated and able to browse
I hope this helps!