cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10007
Views
5
Helpful
27
Replies

Custom WebAuth

wowsersusa
Level 1
Level 1

I am basically trying to take the e-mail pass-through page and manipulate the simple html code say Signature instead of Email Address. However Every time I copy the code and open up the login.html that I upload with the custom webauth page I no longer have a submit button and even when I hit enter it no longer redirects me anywhere. Basically the need for this is to have the users name in the system to log them. We are just trying to figure out if there is a way for a guest to self register themselves by reading a license agreement and then signing at the bottom. Thanks in advance for any help that could be provided

27 Replies 27

Well I gave a few more bundles a try, modifying the html only by adding a redirect url in different areas. Upon clicking the button as a guest user, you still just end up at a "Connection Successfull" screen with the url of "1.1.1.1/login.html" - and it just sits there.

I noticed in your html you have some session information after ACTION="/login.html"

I never see that so I am wondering if this is where my problem is?

Ah nevermind that, thats something that is getting pasted by the cisco website when I send a forum reply. So, this is where I am - even I have editied these two fields in the html from "":

var redirectUrl = "http://www.google.com/";

http://www.google.com/">

As a guest, the passthrough page displays properly. I noticed the full url at this point was:

https://1.1.1.1/fs/customwebauth/login.html?switch_url=https://1.1.1.1/login.html&ap_mac=xx:xx:xx:xx:xx:xx&wlan=xxxxxx&redirect=my_browser_homepage

Checking the source at that point showed the original values of "" instead of the defined www.google.com. When I click the button to proceed, I get the Connection Successfull page with the url:

https://1.1.1.1/login.html

Checking that page's source also does not show www.google.com as a value, but rather:

So I do not know why but something is overwriting the bundle changes I make. I did verify the .tar and apply/save config to the controller prior to testing. Any thoughts?

(Don't yell at me) but I just changed the logo and text of the sample web auth page with Frontpage and it worked fine.

My questions is this.. I'm planning on having web auth against ACS for the internal wireless network, but for a guest network, I'd like to do passthrough. Is there any way to have separate custom pages to do this?

If it's not possible I may just try and restrict SSID's via ACS and make a guest account, although at first try the NAR for restricting SSID's didn't work

Progress is a good thing, I think. I left all the values as they were at default for redirection in the html source. ("") Uploaded the bundle and applied it. CLI'ed into the controller and entered 'config custom-web redirectUrl www.google.com.'

I had thought that field only applied when using the default (Internal) web login page. saved the configuration, logged in as guest and after clicking the button, passed through and redirected to google!

The only problem left, which is potentially a forseeable one for guests, is that we will most likely redirect to our company homepage. A guest will probably then hit their browser homepage button, which sends them back to the passthrough page with a statuscode=1 at the end of the url, leaving them in a loop if they refresh.

If they open another browser session, there is no problem and they go to their usual homepage and are fine. If anyone has any input on that or something to try let me know! almost there!

I did observe the same thing as you today as I'm doing a new WCS/WISM/Wireless deployment.. you beat me to posting it! Even though you choose custom web auth, you still do have to use the config custom-web redirectURL command on the controller itself.

I actually noticed the same thing as you w/ the guest page but didn't try to open a new browser session.. that's the only thing I have to get around as well!

I was able to get the homepage button to send you to your browser's original homepage after using the passthrough page. I was missing a line in my html that prevented cache. I guess without this line the browser session was holding the passthrough page as the homepage. The line was:

So now redirection works as well as the user's homepage button after passthrough! Many thanks to the forum as this was my absolute only means to information.

I am still continuing to work on the page to get it to function like the internal passthrough, meaning it would redirect you to your own browser homepage. I will keep an eye on this thread to help out anyone if I can, and post my own progress.

My HTML page already had that line.

The problem I am running in to now is that when using custom web auth page, the web-passthrough page gets changed as well, and it's different.

TAC had me downgrade controller software to 4.0.179.11.

If you use the default internal web auth pages, you'll see that you get served a different page when you use a WLAN with web-auth versus one with web-passthrough + email input.

I'll let everyone know what I found out with my case..

Definately, there are more scripts added that reference the javascript file when you do more than passthrough. After all the testing I did just to get passthrough working, your custom html working depends highly on where you place the scripts. I'm sure you will figure it out as long as you include the new ones in your page - good luck

I'm using the "custom web auth page", and everything works fine exept when i get rederected back to the webpage if wrong password/username/allready loggen inn etc.

If running the "default web auth page" im returned with this url:

https://xxxxxxx/login.html?switch_url=http://xxxxxx/login.html&ap_mac=xx:xx:xx:a8:27:e0&wlan=xxxx-guest&redirect=www.google.com&statusCode=5

If I switch too the "custom web auth page" I'm missing the parameter "statusCode=" - and therefore gets no alerted errormessage..

Anyone know why?

For the redirect page, is it also works on https page? I have customer who want to redirect to a SSL page (intranet) when users connect to the wireless network.

Could it done by modifying the custom login page redirect_url hidden html field??

Thanks.

Has anyone figured out getting redirect to the user's desired page working on a custom web auth configuration?

TIA for any pointers.

Working: redirect to user's desired URL

Not long after I posted asking about redirecting to the user's desired page, I found a workaround.

I had been using the built-in default web auth files as a template and customized.

There are webauth bundle examples on CCO that someone mentioned, so I searched and found them. In those examples, they don't use a loginscript.js - they just put whatever functions they need in the html page.

At any rate, there is a newer submitAction function in the example I looked at. I replaced the previous version and all works as expected.

Just in case somebody is having the same problem.

I did a "view source" from the internal web auth webpage and saved it to login.html.

The internal webpage file path and the "Customised (Downloaded)" filepath are two different locations. So when you upload the login.html page you also need to bundle in loginscript.js (however I would rename loginscript.js to something else and change the reference to it in login.html). Here is the code for loginscript.js

function getHtmlForButton(nameStr, str, bClass,onClickFn){
    if(nameStr == null || nameStr ==""
      || str == null || str ==""
      || onClickFn == null || onClickFn =="") {
        debugMsg("One of the input params for the button is not available");
        return;
    }
    document.writeln('');
}

function submitAction(){
  if(document.forms[0].err_flag.value == 1){
    // This case occurs when user's attempt to login failed
    // and he is going to login again. This means we have already
    // extracted redirect url in his first attempt and its stored
    // in redirect_url input element. so just submit the form
    document.forms[0].err_flag.value = 0;
    document.forms[0].buttonClicked.value = 4;
    document.forms[0].submit();
  }else{
      var link = document.location.href;
      //alert("Link is "+link);
      var searchString = "?redirect=";
      var equalIndex = link.indexOf(searchString);
      var redirectUrl = "";
      if(equalIndex > 0) {
            equalIndex += searchString.length;
            redirectUrl=link.substring(equalIndex);
            var index=0;
            //add http only if url does not have
            index=redirectUrl.indexOf("http");
            if(index != 0){
               redirectUrl = "http://"+ redirectUrl;
            }
      }
      if(redirectUrl.length > 255){
          redirectUrl = redirectUrl.substring(0,255);
      }
      document.forms[0].redirect_url.value = redirectUrl;
      //alert("redirect url is "+document.forms[0].redirect_url.value);
      document.forms[0].buttonClicked.value = 4;
      document.forms[0].submit();
  }
}

function submitOnEnter(event)
{
  var NS4 = (document.layers) ? true : false;
  var code = 0;
  if (NS4)
    code = event.which;
  else
    code = event.keyCode;
  if (code==13) submitAction(); // 12 corresponds to enter event
}

function checkForMsg(){
    if(document.forms[0].info_flag.value == 1){
        alert(document.forms[0].info_msg.value);
    }
}

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card