This question about Authentication or Authorisation: Answered
Case Sensitive LDAP logons
I just installed FOSWiki 1.1.3 and configured LDAPContrib using roughly the same settings from my previous TWiki install and found that I can now only log on using the 'case sensitive' username (upper case) from the sAMAccountName attribute on AD which wasn't the case on my other install.
I notice that the cache.db on my TWiki 4.2.2 install has lower case entries for the usernames and shows as upper case in the cache.db for my FOSWiki 1.1.3 install.
My questions are:
- Am I missing something?
- Are the logons case sensitive?
- How can I either:
- Get the cache.db to populate with lower case usernames? or
- Get the logon handler to ignore case when logging on? or
- something else entirely to solve my problem?
I had a read through (without joy so far):
--
HughBlair - 18 Jul 2011
Sorry, no help but just a confirmation: I've noticed the same behaviour (not being able to log in using upper case sAMAccountNames) in Foswiki 1.1.3 with the latest
LdapContrib (v4.30). In Foswiki 1.0.9 with
LdapContrib v3.1.1 upper case user names worked OK.
--
MartinKaufmann - 19 Jul 2011
So... "To backrev or not to backrev, that is the question"
--
HughBlair - 19 Jul 2011
This is a known issue. There was a recent change to make logins case sensitive everywhere as some people where complaining about
that.
However the use case to have a case insensitive login is quite frequent as people don't want having to remember upper/lower case of their login.
So LdapContrib needs a new setting to distinguish these use cases... something like
{LoginCase} = 'upper|lower|default'
Here's a quick and dirty hack for
NatSkin to uppercase login names during template login. Save this file as
loginbase.uppercaselogin.tmpl
%TMPL:INCLUDE{"loginbase"}%
%TMPL:DEF{"useractions"}%<div class='natGreeter'> </div>
%ADDTOZONE{"body"
text="<literal><script>
jQuery(function($) {
$('#LoginForm').submit(function() {
var $this = $(this),
$usernameField = $this.find('input[name=username]');
username = $usernameField.val();
if (username != 'admin') {
$usernameField.val(username.toUpperCase());
}
});
});
</script></literal>"
}%<!-- -->
%TMPL:END%
And add
uppercaselogin
to your SKIN path. A similar hack should be possible for
PatternSkin.
--
MichaelDaum - 20 Jul 2011
Here is a hack for
PatternSkin. It actually converts all uppercase login names in the login form to lower case (that's what I needed). Save it as
templates/login.lowercase.tmpl
and add
lowercase
to
Set SKIN
.
%TMPL:INCLUDE{"login"}%
%TMPL:DEF{"submit"}%<input tabindex='4' type='submit' class='foswikiSubmit' value='%MAKETEXT{"Logon"}%' onClick='makeLowercase();' />
<script>
function makeLowercase() {
document.loginform.username.value = document.loginform.username.value.toLowerCase();
}
</script>
%TMPL:END%
--
MartinKaufmann - 20 Jul 2011
Case-(in)-sensitive login is part of the latest release.
--
Main.MichaelDaum - 11 Sep 2015 - 14:30