AAA, NAC, Guest Access & BYOD

How to convert the password case to upper or lower in the web-login before submit

Aruba Employee

Introduction- This Article helps you to convert password string to lower or upper case when you submit the web login page for user authentication.

ClearPass can be integrated with external SQL databases like PostgreSQL, MSSQL, Oracle 11g, etc,. We recently came across a request to use Visitor-ID as username and Visitor Last Name as password. But the last name in the MSSQL DB was stored in Upper case letters. Instead of asking the visitors to enter the password in upper case we did convert the password string to upper case before submitting the login page and got the authentication working. Below steps will guide you with the conversion.

Environment- Applicable to all the ClearPass 6.x version.

Configuration Steps- Create a custom web-login page and paste the below custom code in the Header HTML.

Navigation : ClearPass Guest Manager >> Configuration >> (Pages) >>Web Logins.

{nwa_cookiecheck}
<div align="center" width="100%">
<p><font color="000000">
    Please login to the network using your
    username and password.
</font><br /></p>

{if $errmsg}{nwa_icontext type=error}{$errmsg|escape}{/nwa_icontext}{/if}

<form method="POST" accept-charset="UTF-8" enctype="application/x-www-form-urlencoded" novalidate="novalidate">
{if $radius_weblogin.username_auth == 'anonymous'}<div style="display:none;">{/if}
<p>
<font color="000000"><b><label for="username">Username:</label></b><br />
<input type="text" style="width: 200px;" autocapitalize="off" autocorrect="off" spellcheck="false" id="username" name="username" value="{$username|escape}"><br />
{if $username_error}<span class="nwaError">{$username_error|escape}</span><br />{/if}
</p>
{if $radius_weblogin.username_auth == 'username'}<div style="display:none;">{/if}
<p>
<font color="000000"><b><label for="password">Password:</label></b></font><br />
<input type="password" style="width: 200px;" id="password" name="password"><br />
{if $password_error}<span class="nwaError">{$password_error|escape}</span><br />{/if}
</p>
{if $radius_weblogin.username_auth}</div>{/if}

{if $radius_weblogin.login_terms_require}
<p>
<label for="visitor_accept_terms"><input type="checkbox" name="visitor_accept_terms" id="visitor_accept_terms" />I accept the </label><a href="{nwa_global name=guest_account_terms_of_use_url}" target="_blank">terms of use</a></br />
{if $visitor_accept_terms_error}<span class="nwaError">{$visitor_accept_terms_error|escape}</span><br />{/if}
</p>
{/if}
<input type="submit" style="width: 200px;" id="submit" name="submit" value="Log In" onclick="return convertcase();">
<script type="text/javascript">
 {literal}
    function convertcase() {
          var passwd = document.getElementById("password").value.toUpperCase();
        document.getElementById("password").value = passwd
        
         }
    {/literal}
</script>
</form>

Ensure to enable the option "Provide a custom login form" in the web-login page. Please refer the below screen

captures.

rtaImage.png

rtaImage (1).png

Answer- The Java Script Added in the above custom code will convert the password string to upper case and then submit the credentials when you click login. Please refer the below output from the browser >> Inspect, that shows the password has converted to upper case and submitted for user authentication.

rtaImage (2).png

 

rtaImage (3).png

If you want to convert the password to lower case, then replace the following line in the code.

var passwd = document.getElementById("password").value.toLowerCase();

Version history
Revision #:
1 of 1
Last update:
‎04-01-2015 10:17 PM
Updated by:
 
Labels (1)
Contributors
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: 
Is this a frequent problem?

Request an official Aruba knowledge base article to be written by our experts.