How to make a username case insensitive?

2
Hi there, I have the same problem as mentioned in this topic: in my app, usernames are emailaddresses and as e-mailaddresses aren't case sensitive, I'd like to have a case-IN-sensitive check in the login-procedure. After reading the topic I refer to, I tried to figure out how to realize this. I have a working solution, but like to hear from you if there are better solutions, as this one is very tricky. What I did is: Open mendix.js in my local Mendix installation directory path: \runtime\mxclientsystem\mendix I changed the code a bit: var _1116=this.usernameNode.value.toLowerCase() (the bold part, I added) As this .js file is clearly not meant for editing (it is compressed, it is large and apparently contains a lot of logic (and thus, editing seems risky): are there better ways to realize what I want?
asked
1 answers
1

Strange... in my testing, the Mendix username is case-in-sensitive. The password is case-sensitive, but not the username.

Do you have LDAP authentication, so the case-sensitivity is coming from LDAP and not Mendix?

Edit: If you are using login.html as your login page, you could add a javascript onChange action to the form as follows:

<input type="textfield" name="username" class="formInput" onchange="javascript:this.value = this.value.toLowerCase();"/> 

Edit 2: If you are using the Login Form widget, you can make a similar change. Find the LoginSystem.mpk file in your project widgets directory, rename it to a .zip extension then unzip the contents. Locate the LoginForm.html file in the templates directory and edit it to add the same javascript action:

<input type="text" class="${baseClass}_usernameInput" dojoattachpoint="usernameInput" onchange="javascript:this.value = this.value.toLowerCase();"/>

Zip up the widget again and change the extension back to .mpk

Changing an HTML page or a widget is much safer than editing mendix.js file IMHO

answered