Feature #6166


Support german umlauts and whitespaces in login string

Added by Max Meier almost 14 years ago. Updated over 2 years ago.

Accounts / authentication
Target version:
Start date:
Due date:
% Done:


Estimated time:


I am using redmine to authenticate with a Lotus Notes LDAP server. Unfortunately the validated login string can contain umlauts and whitespaces, like in the name "Max Müller". Redmine by default does neither allow non-ascii characters nor whitespaces in the login string.

If there is no other reason, why special characters must not be used, I think one could localize the validation pattern by extracting it into config/locales to be configured individually for each language.

For myself now, I changed app/models/user.rb

validates_format_of :login, :with => /^[a-z0-9_\-@\.]*$/i

validates_format_of :login, :with => /^[a-z0-9_ äüöéßÄÜÖ\-@\.]*$/iu

which suits my needs very well.

Please let me know, if this is a good idea.


patch.txt (1000 Bytes) patch.txt Patch for login names containing umlauts and accent d'aigu Max Meier, 2011-12-14 11:03
feature-6166.diff (1.45 KB) feature-6166.diff Go MAEDA, 2016-02-02 10:31

Related issues

Related to Redmine - Patch #811: Username validation - allow spaces...NewJean-Philippe Lang2008-03-08

Related to Redmine - Feature #21923: net-ldap 0.12.0 - 0.12.1 dropped support of UTF-8ClosedJean-Philippe Lang

Actions #1

Updated by Max Meier over 12 years ago

Upgrading to redmine 1.2.2 I created a patch for app/models/user.rb, which allows german umlauts and accent d'aigu in login names. The regexp pattern is extended with unicode quoted characters, so it should run also without requiring cp1232 or such.

Could you please integrate this into official redmine versions?

Actions #2

Updated by Daniel Albuschat over 12 years ago

I ran into the same problem with 1.3.0 and used the same "hack" to fix it (I manually edited user.rb).
Why hasn't this patch been incorporated?
Why is that validation necessary, anyways?

Actions #3

Updated by Piotr Karasinski over 11 years ago

Just stumbled upon the same issue with danish characters. The name of this thread should maybe be changed to "national characters in login string" or something. Anyway the difference for me was that these national characters are not ASCII, and apparently the app/models/user.rb file in its unmodified form is ASCII encoded. So I needed to add the following code on the very top of the file:

# -*- coding: utf-8 -*-

otherwise it failed with an error (at least it did for me) when accessing Redmine.

Actions #4

Updated by Daniel Felix over 11 years ago

Well we encountered the same Problem. It would be great to have this enabled in the next release.
I currently disabled just the Loginname validation as we are using LDAP for our user management. But this way we just need to change some core code on every release to get this thing working.

Actions #5

Updated by Philipp erpel almost 11 years ago

I just want to add myself as one more victim of this shortcoming. It's 2013 and we should be able to use proper usernames by now. Please consider to extend the allowable characters.

Actions #6

Updated by Gregor Borsemirk over 9 years ago

I also just came across this issue where I was authenticating against LDAP.
This user had a german 'umlaut' in his user name and redmine always was rejecting a login with 'invalid user name'

The fix from Max Meier works for me in Redmine 2.6.3
So thanks to Max!

Actions #7

Updated by int redmine over 8 years ago

It is not only login causing issues when containg umlauts.
I also get an Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.
If you are the Redmine administrator, check your log files for details about the error.

during account creation on first time login by LDAP.
This is also caused by umlauts in first name/Last name

account creation through normal register procedure is working, when first name/Last name contain umlauts.

Actions #8

Updated by Toshi MARUYAMA over 8 years ago

int redmine wrote:

It is not only login causing issues when containg umlauts.
I also get an Internal error

This is because of #21453.

Actions #9

Updated by Andreas Deininger over 8 years ago

I ran into the same problem with Redmine version 3.2.0 and successfully used the patch above to overcome the limitation I encountered.
I would appreciate if this issue could be addressed in a future version of Redmine.

Actions #10

Updated by Go MAEDA over 8 years ago

Here is a patch for r15144.
[:alnum:] covers umlauts.

Actions #11

Updated by Toshi MARUYAMA over 8 years ago

  • Related to Feature #21923: net-ldap 0.12.0 - 0.12.1 dropped support of UTF-8 added
Actions #12

Updated by Andreas Deininger over 2 years ago

More than 6 years later, I again ran into the same problem when updating my Redmine instance to version 4.2.4. Again, I successfully used the patch above to overcome the limitation I encountered.
I really would like to see this issue addressed in future Redmine versions.

Pleas note, that I'm not the only one, this note is basically the same problem with german characters, but no one seems to be interested.
Actions #13

Updated by C S over 2 years ago



Also available in: Atom PDF