= Description =
When using Moin with LDAP authentication, you are faced with the following problem:
* LDAP authentication is case-insensitive, you can have sAMAccountName ''(if it's the parameter you check for login)'' have {{{FirstName.LastName}}} and you can log in with {{{firstname.lastname}}} or {{{FIRSTNAME.LASTNAME}}}: that's ok for me, i found it logical ''(or at least practical)''
* Moin account creation is case-sensitive, if you log in (independently of the way it works) with {{{LoginName}}} and {{{loginname}}} you get two accounts created.
Case-sensitiveness is not the problem here, but the fact that if you log against LDAP with {{{firstname.lastname}}} or {{{FirstName.LastName}}}, you are logged with the same account (you're the same person!) but Moin creates two internal accounts, that's disturbing and complicates management (example ACL management).
== Steps to reproduce ==
1. configure moin to use LDAP authentication
1. choose a LDAP account and log into Moin with its login name in upper case (like this {{{LOGINNAME}}})
1. creates a page, for example your homepage by clicking on your {{{LOGINNAME}}} in the upper left
1. log out
1. log in with the same account and password but this time with the login name in lower case (like this {{{loginname}}})
1. see that your homepage isn't created
== Example ==
== Component selection ==
* general
== Details ==
== Workaround ==
One workaround is to explain to every LDAP user to '''always''' spell their login name the same way. [[https://en.wikipedia.org/wiki/Murphy%27s_law|Murphy]] disagrees with this. -k-method
Another solution is to patch the login.py userform such that the user is forced to enter a lowercase username. This workaround is only suitable for new installations or installations where all existing usernames are lowercase (or have been converted to lowercase in advance). If there are already accounts which contain usernames with uppercase chars then it will not be possible to login to those accounts. -k-method
Here is the patch:
{{{#!highlight diff
--- a/moin-1.9.8/MoinMoin/userform/login.py Fri Oct 17 20:45:32 2014
+++ b/moin-1.9.8/MoinMoin/userform/login.py Fri May 22 12:38:38 2015
@@ -39,7 +39,7 @@
hint = authm.login_hint(request)
if hint:
hints.append(hint)
- self._form = html.FORM(action=action, name="loginform", id="loginform")
+ self._form = html.FORM(action=action, name="loginform", id="loginform", onsubmit="return checkForm(this);")
self._table = html.TABLE(border="0")
# Use the user interface language and direction
@@ -54,7 +54,7 @@
cfg = request.cfg
if 'username' in cfg.auth_login_inputs:
- self.make_row(_('Name'), [
+ self.make_row(_('Windows Username'), [
html.INPUT(
type="text", size="32", name="name",
),
@@ -66,6 +66,18 @@
type="password", size="32", name="password",
),
])
+
+ self._form.append("""
+ """)
# Restrict type of input available for OpenID input
# based on wiki configuration.
}}}
'''Please note:''' this patch changes the prompt from "Name" to "Windows Username" on the login form. I assume that it's only windows installations where this is a problem. I'm not aware of any other popular operating systems that have case insensitive usernames. -k-method
'''Please also note:''' this is clearly not a permanent solution to this very real problem. It's a temporary work-around that works very well for the MoinMoin installation at the company I work for. -k-method
= Discussion =
I'm not sure this bug is really a bug, because account case-sensitiviness is a feature<>. But it could be interesting to:
* if LDAP auth is used, account creation become case-insensitive or
* Moin offers a way to disable case-sensitiviness in account creation, for example via a directive in the config file.
(!) We won't make moin case-insensitive. That is just bad style, slower and only makes trouble all over the place (as you see with ldap, windows, ...).
I'm ok with this as I said before.
What maybe could be done is reading back the username from ldap to see how it really is. Patches are welcome.
You mean, when using ldap auth, connect whatever is the login name used, if it's ok, retrieve a ldap attribute (configurable?) and use it for account creation? I'll try to look if i find where it can be done.
= Plan =
## This part is for Moin``Moin developers:
* Priority:
* Assigned to:
* Status:
----
## If you are a moin core developer, replace the category to Category* in these cases:
## Category MoinMoinNoBug - if this is not a bug.
## Category MoinMoinBugConfirmed - if you can confirm the bug on current code.
## Category MoinMoinBugFixed - after the bug is fixed in current code.
CategoryMoinMoinNoBug