Welcome, Guest. Please login or register.
Did you miss your activation email?
+  pfSense Forum
|-+  pfSense English Support» Captive Portal» Captive Portal on External Server??
Username:
Password:
 
 

Pages: [1]   Go Down
  Print  
Author Topic: Captive Portal on External Server??  (Read 2724 times)
0 Members and 1 Guest are viewing this topic.
rahulmkhj
Newbie
*
Offline Offline

Posts: 4


View Profile
« on: February 08, 2012, 07:34:27 am »

Hello Everyone!

I want to put my captive portal pages i.e. splash, login form etc. on some external web server and when user tries to connect redirect them to that (login page on external server) instead of one hosted on pfsense itself. Is that possible??

Thank you,

Rahul
Logged
wallabybob
Hero Member
*****
Offline Offline

Posts: 4799


View Profile
« Reply #1 on: February 08, 2012, 05:20:02 pm »

I expect its possible.

What should happen if the external server is unavailable?

Who does the authentication - pfSense or external server? If pfSense, how will you pass the login parameters back to pfSense securely? If external server, how will you pass the authentication result back to pfSense securely?

What "problem" are you trying to solve by doing this? There might be simpler ways of achieving a "similar enough" outcome.
Logged
rahulmkhj
Newbie
*
Offline Offline

Posts: 4


View Profile
« Reply #2 on: May 13, 2012, 04:56:57 am »

Hey,
Sorry for my late reply.

If external server is not available, it ll just not redirect anywhere.. (I'll manage redundant web servers for that ).
authentication will be done by external stand alone radius server only. pfsense is to act as controller only & act upon attributes received from RADIUS server. login parameters can be passed over 443 (https://) or we can MD5 them if on 80(http://).

What I'm trying to do is: we do have a panel for network operators to manage their respective users, and I want to offer them ability to customize login page for their users from within the same panel. That, i think, is not possible.. when hosted on pfsense itself.

Thank you,
Logged
miken32
Newbie
*
Offline Offline

Posts: 5



View Profile WWW
« Reply #3 on: June 08, 2012, 01:04:25 pm »

This is one of a number of features missing from pfSense to make managing large numbers of servers easier! Imagine having to upload a new HTML file to 50 boxes and you see how tedious it might get.

OP: has a feature request been submitted for this?
Logged
dhatz
Hero Member
*****
Offline Offline

Posts: 925


View Profile
« Reply #4 on: June 08, 2012, 01:13:31 pm »

This is one of a number of features missing from pfSense to make managing large numbers of servers easier!

I believe there is an upcoming product called pfCenter that will take care of this.
Logged
dseira
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #5 on: June 19, 2012, 06:53:02 am »

I have the same problem.

 I've made a index.php that redirect to the external page. This external page has the login form (username/password), the problem is that I don't know how to send the user values to the pfSense for make the authentication.


Are there any way to implement this feature in pfSense 2.0? Is it possible?

Thanks.
Logged
mdmogren
Newbie
*
Offline Offline

Posts: 20


View Profile
« Reply #6 on: September 11, 2012, 02:36:33 am »

I came up with this to use an external splash page:

1) Make sure to add the host where you're going to host your page to Allowed Hostnames

2) Use this code to redirect and pass the variables, (I only passed a few here that I needed, you can add more using the same method) the only downside is that if a user has JavaScript disabled in their browser they will have to click a button to load the page...

Make you you replace "http://www.myserver.com/splashpage.php" with the URL you want to redirect to.

Code:
<script>
document.write('<style>.noscript { display:none }</style>');
</script>
<form action="http://www.myserver.com/splashpage.php" method="post" id="redirectform">
<input type="hidden" name="client_mac" value="$CLIENT_MAC$">
<input type="hidden" name="client_ip" value="$CLIENT_IP$">
<input name="action" type="hidden" value="$PORTAL_ACTION$">
<input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
<span class="noscript">Javascript is disabled, click to
<input name="submitx" type="submit" value="Continue" />
</span>
</form>
<script type="text/javascript">
    function doredirect () {
        var frm = document.getElementById("redirectform");
        frm.submit();
    }
    window.onload = doredirect;
</script>

3) You'll then be able to pull on the variables from $_POST on your new page.
Example code for your external page:

Code:
<form method="post" action="<?php echo $_POST['action']; ?>">
   <input name="auth_user" type="text">
   <input name="auth_pass" type="password">
   <input name="redirurl" type="hidden" value="<?php echo $_POST['redirurl']; ?>">
   <input name="accept" type="submit" value="Log In">
</form>
Logged
Caffeine311
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #7 on: November 19, 2012, 04:43:07 pm »

I'm having some trouble with what you posted mdmogren. It redirects to the external portal just fine, but it doesn't seem to want to pass the login information back to pfsense to complete the radius authentication. Am I missing something for radius? No matter what I input for the user/pass, when I click "login" it instantly redirects to the external portals domain followed by "/$PORTAL_ACTION$?auth_user=test&auth_pass=1234&accept=LOGIN"

Code:
<form action="$PORTAL_ACTION$" align="center"><br />
<img src="../../hotel.png" width="400" height="400" title="" alt="" /><br />
<br /><input name="auth_user" type="text" /><input name="auth_pass" type="password" /><input name="accept" type="submit" value="LOGIN" /></form>

I'm sure i'm missing something stupid. I'm just learning HTML/PHP. I can make everything work if I upload portal directly to pfsense, just not using the external portal which is what I need.

Thanks in advance for any advice.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

 

Page created in 0.029 seconds with 20 queries.