Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Users might experience few discrepancies in Search results. We are working on this on our side. We apologize for the inconvenience it may have caused.
New Member

Custom WebAuth

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
New Member

Re: Custom WebAuth

im having the same issue, and ive looked up and down cisco's site for some help. the most ive come up with is a general guide on what fields to code, like "make sure you capture the redirect url".

ive copied the source code of the internal auth page, modified it, tar'd it, and uploaded successfully. the javascript does not work, there is no submit button, and none of the basic cisco banners are there. i assume its because of the directory structure, which is not documented.

i do see in figure 9-14 (here: http://www.cisco.com/univercd/cc/td/doc/product/wireless/control/c44/ccfig40/c40users.htm#wp1053578 ) that there is a submit button and a terms button. i would be ecstatic if i could find out how that terms button works.

all i need is a "ive read the terms and agree to them" page, along with the terms for them to read. modifying the internal page does not allow for carraige returns so this is not acceptable for my use.

please help with this issue, ive seen it posted a few times and no answers that i can find.

New Member

Re: Custom WebAuth

Hello,

When i followed the instruction given by cisco literature on creating a customized webauth page, it doesn't work. The downloaded sample has a "no-action" javascript which basically does nothing. In order for the submit button to work, you need to configure the WLC to work with the internal webauth page, associate to the WLAN with webauth and open IE browser to be prompted with the actual login page. There you need to save the webpage and you'll get the REAL sample with workable login javascript. make sure you have the file "loginscript.js" in the "web Authentication_files" directory. Do your modification and tar the entire package. Don't forget to rename the html to login.html. Make sure you "APPLY" the customized page in security>web login> I'm still having some problem with this method, but I'll post this in another thread.

New Member

Re: Custom WebAuth

Well Thank you for your post but I figured this out lte november. You are correct in saying about the javascript.js file. My problem was I edited it using VI and for some reason it put some non-standard ascii characters in my Javascript. I just downloaded the page again and it works. The only other problem I had was inside the controller I had to make sure under WLAN passthrough had e-mail checked in order for me to send login information to an accounting server.

New Member

Re: Custom WebAuth

Can you assist me with redirecting via editing the javascript.js file? I have the js file, but don't know where to put the url. I'm using SourceEditor (it's free) Thanks much!

New Member

Re: Custom WebAuth

Hello Ms. Jennifer,

What exactly are you trying to do? What we did for our company is create a custom webpage with a EULA designed by lawyers with a signature block at the bottom instead of E-mail. Then under the WLAN Layer 3 Security I selected WebPolicy then I selected passthrough and E-mail input. Essentially I cheated and made the Input E-mail ay Signature. I will be glad to help in any way I can.

New Member

Re: Custom WebAuth

I have edited the basic web splash screen, and want the accept/submit button to redirect guest users to a different website. I believe when I upload a custom web auth page, I need to have a complete html file, and cannot use the redirect field that is only present on the controller when I am using the internal (default) web auth page. I do not know how to redirect based on a javascript file. I don't know where to specify the url, or how the js file parses the url. Thanks for your help!

New Member

Re: Custom WebAuth

Actually it is on your splash screen html file where you need to put the redirect.

Look for Form method part of your html code and this is what I had to enter for it to redirect the url to another website. Do not edit the javascript file it will screw things up. I learned that lesson. Let me know if this helps.

New Member

Re: Custom WebAuth

The FORM section of the html I pulled down looked like this:

value=0 name=buttonClicked>

name=err_flag>

type=hidden maxLength=15 size=16 value=0 name=info_flag>

maxLength=31 size=32 name=info_msg>

name=redirect_url>

I edited this section to get the redirect to work:

http://www.google.com" method=post>

Thanks so much for heading me in the right direction!

I also realized that I had accidentally made the login.html a login.htm and the webauth bundle would not extract properly. I kept getting the error:

Error extracting webauth files.

Once I renamed the login.htm to .html the upload worked.

New Member

Re: Custom WebAuth

Actually - my post wasn't correct - the redirect worked from the controller preview, but not as a redirected user.

The section I edited to make it work was this:

name=redirect_url value="http://www.google.com">

Wanted to clarify for any other people having issues. Controller code version is:4.0.206.0, and it is a WLC 4402-50.

New Member

Re: Custom WebAuth

This is a good thread, as I have been having problems with web passthrough for guests since day 1 of upgrading to 4.0.179.11. I feel as though I am very close, a guest user now will see our custom passthrough page, click a button stating they have read the above usage information, and get to the "connection successfull" page.

From here, nothing happens: there is no redirect. You can manually change your url and use the internet as you should. If you click your home page button you end up back at the passthrough page, where if you click the button again it just loops the same page. Here is the popular part of my html: If anyone has any suggestions, I greatly appreciate it. TAC has responded that they will not assist with custom made pages. If anyone wants to email me directly, I am at mikematulevich@yahoo.com.

New Member

Re: Custom WebAuth

Mike what you have to edit or add is up above the FORM method area. I remember having to add in some of my own code which I posted pretty much a whole block and you should be able to figure out where it goes.

New Member

Re: Custom WebAuth

Thanks wow, good stuff. You didn't do any modifications to your javascript file I hope?

I think the only real difference in the html I somehow missed was the

var redirectUrl = "www.google.com"

I thought for some reason if all these values were set to "", then it would redirect the user's specific home page. I will give this a shot. That being said, for the line a little lower on your html:

Did you have to specify the VALUE="www.google.com" in that portion, or did you leave it ""

Thanks in advance!

New Member

Re: Custom WebAuth

FYI for anyone. DO NOT Modify the java script I had many problems when I did.

New Member

Re: Custom WebAuth

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?

New Member

Re: Custom WebAuth

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?

New Member

Re: Custom WebAuth

(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

New Member

Re: Custom WebAuth

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!

New Member

Re: Custom WebAuth

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!

New Member

Re: Custom WebAuth

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.

New Member

Re: Custom WebAuth

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..

New Member

Re: Custom WebAuth

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

New Member

Re: Custom WebAuth

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?

New Member

Re: Custom WebAuth

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.

New Member

Re: Custom WebAuth

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

TIA for any pointers.

New Member

Re: Custom WebAuth

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.

New Member

Re: Custom WebAuth

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);
    }
}

7710
Views
5
Helpful
27
Replies
CreatePlease to create content