changeset 5658:dba6c44f0a30 stable

auth: Fix bug where usernames are not consistently capitalized when using crowd login If you try to log in to Kallithea via the Crowd auth module then the capitalization of your username in Kallithea changes on every login based on how you capitalized it in the login form. E.g. Log in with "TestDude", username is entered as "TestDude" then log in again, but this time as "tesTduDe", and your username gets changed to "tesTduDe". etc. Fix for this is to use the 'name' field returned from Crowd when saving the username. This way the username is always capitalized identically to the record in Crowd.
author Robert James Dennington <tinytimrob@googlemail.com>
date Fri, 15 Jan 2016 14:55:27 +0000
parents 18c9eb22c29c
children 41fc338a810f 9e53eb77287c
files kallithea/lib/auth_modules/auth_crowd.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/auth_modules/auth_crowd.py	Fri Jan 15 14:38:27 2016 +0000
+++ b/kallithea/lib/auth_modules/auth_crowd.py	Fri Jan 15 14:55:27 2016 +0000
@@ -222,7 +222,7 @@
         lastname = getattr(userobj, 'lastname', '')
 
         user_data = {
-            'username': username,
+            'username': crowd_user["name"] or username,
             'firstname': crowd_user["first-name"] or firstname,
             'lastname': crowd_user["last-name"] or lastname,
             'groups': crowd_user["groups"],