Convert the input login name to lowercase and possibly strip any non-alphanumeric characters from it before checking. I had run into a problem with the client using an iphone to login and the iphone automatically converted the name to proper case which failed the check of the lowercase username.