View Issue Details

IDProjectCategoryView StatusLast Update
0004363SOGoBackend Generalpublic2018-03-01 16:21
Reporterbofhus Assigned Tofrancis  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSCentosOS Version7
Product Version2.3.23 
Fixed in Version4.0.0 
Summary0004363: Unable to login with filed another then UID
Description

SOGoUserSources = (
CNFieldName = displayName;
UIDFieldName = uid;
bindFields = (mail);
...
}

This configuration is working correclty in SOGo 2.2.16, but when I tried it in 2.3.23, the problem appears:

After entering e-mail as login, correct password and "remember username" selected, SOGo redirects me to the same login page, but in the login field my UID appears instead e-mail, which I entered.

When I changed it to "bindFields = (mail,uid)" I'm able to log in, but SOGo remembers my UID as login, so when I logged out, the login page appears with the UID in login field. There always should be the email, uids aren't friendly for my users.

I'm using multidomain configuration.

Steps To Reproduce

Just try it with this config.

Additional Information

The SOGo is compiled from sources.

SOGoHideSystemEMail = YES;
SOGoForceExternalLoginWithEmail = YES;

TagsNo tags attached.

Activities

ludovic

ludovic

2018-01-12 19:33

administrator   ~0012508

Show your full config.

bofhus

bofhus

2018-01-12 20:14

reporter  

sogo.conf (2,114 bytes)
bofhus

bofhus

2018-01-12 20:14

reporter   ~0012509

I uploaded it as attachement

bofhus

bofhus

2018-01-24 22:03

reporter   ~0012533

Well, probably the bug, which disables posibility of log in to SOGo is minor for you, but it would be nice to confirm the problem at least - is it reproduceable in your enviroment, when it will be corected (if ever?), maybe a little patch? I reported the problem over a month ago...

efuste

efuste

2018-01-25 11:41

reporter   ~0012534

You choose to define UIDFieldName = uid
So your primary login method is by uid. Witch is what the "remember username" will retain.
Your config worked "by chance" with 2.2.
How is constructed you directory and especially the rdn of your users ?
With 2.3 there was a change in the multidomain handling which could choke with the existing content of your profiles.

Anyway, in your case you shoud have used UIDFieldName = mail and bindFields = (uid) if your RDNs are uid based.
But if you change it now, all your profiles will be lost or your database need to be script post-processed.

We have the exact opposite:
UIDFieldName = uid and bindFields = (uid) because all our users are using their uid anywhere.
email login still work because it is hardcoded in SOGo, but "remember username" correctly use the uid.

SOGoForceExternalLoginWithEmail = YES is only used for connexions between SOGo and your SMTP server and change nothing to the web login process.

If you have a test platform, do some tests with a clean database and your existing ldap server.

bofhus

bofhus

2018-01-25 17:46

reporter   ~0012537

Last edited: 2018-01-25 17:51

This is an example of my user record in LDAP:

dn: cn=u00051,o=bingo,dc=mydomain,dc=local
objectClass: top
objectClass: person
objectClass: knkPerson
cn: u00051
o: bingo
mail: bogdan@bingo.mydomain.pl
uid: u00051-bingo
knkMailQuota: 8192
displayName: <edited>
givenName: <edited>
sn: <edited>
telephoneNumber: <edited>

The UID field is just a number plus an group name (based on domain).
UID is unique forever, mail could be reused.

I set the UIDFieldName = UID because it is the best ID for database, but users always login using the e-mail address.

The bindFields config means the fields, which user can use to login. And "remember username" should remember the username entered by user, not replaced by the another one.

Is it any method, how to destroy the "remember username" feature? I could remove it from the forms (probably?), but what happens if the user already selected this checkbox?

bofhus

bofhus

2018-02-18 13:00

reporter  

remember_username.patch (1,095 bytes)   
diff -Naur SOGo-2.3.23.orig/UI/MainUI/SOGoRootPage.m SOGo-2.3.23.new/UI/MainUI/SOGoRootPage.m
--- SOGo-2.3.23.orig/UI/MainUI/SOGoRootPage.m	2017-10-18 17:22:39.000000000 +0200
+++ SOGo-2.3.23.new/UI/MainUI/SOGoRootPage.m	2018-02-18 13:22:24.000000000 +0100
@@ -185,6 +185,7 @@
   SOGoUserDefaults *ud;
   SOGoUser *loggedInUser;
   NSString *username, *password, *language, *domain, *remoteHost;
+  NSString *ousername;
   NSArray *supportedLanguages;
   
   SOGoPasswordPolicyError err;
@@ -198,6 +199,7 @@
 	    authenticatorInContext: context];
   request = [context request];
   username = [request formValueForKey: @"userName"];
+  ousername = username;
   password = [request formValueForKey: @"password"];
   language = [request formValueForKey: @"language"];
   rememberLogin = [[request formValueForKey: @"rememberLogin"] boolValue];
@@ -263,7 +265,7 @@
     }
 
   if (rememberLogin)
-    [response addCookie: [self _cookieWithUsername: username]];
+    [response addCookie: [self _cookieWithUsername: ousername]];
   else
     [response addCookie: [self _cookieWithUsername: nil]];
 
remember_username.patch (1,095 bytes)   
bofhus

bofhus

2018-02-18 13:04

reporter   ~0012611

Near two month passed. No any help from developers. So I decided to make a workaround myself (God, why I have waited so long?). I attached a simple patch.

francis

francis

2018-03-01 16:21

administrator   ~0012622

Thanks!

Related Changesets

sogo: master d49219ce

2018-03-01 11:17

francis


Details Diff
Save original username in cookie

Fixes 0004363
Affected Issues
0004363
mod - NEWS Diff File
mod - UI/MainUI/SOGoRootPage.m Diff File

Issue History

Date Modified Username Field Change
2017-12-22 20:31 bofhus New Issue
2018-01-12 19:32 ludovic Severity major => minor
2018-01-12 19:33 ludovic Note Added: 0012508
2018-01-12 20:14 bofhus File Added: sogo.conf
2018-01-12 20:14 bofhus Note Added: 0012509
2018-01-24 22:03 bofhus Note Added: 0012533
2018-01-25 11:41 efuste Note Added: 0012534
2018-01-25 17:46 bofhus Note Added: 0012537
2018-01-25 17:50 bofhus Note Edited: 0012537
2018-01-25 17:51 bofhus Note Edited: 0012537
2018-02-18 13:00 bofhus File Added: remember_username.patch
2018-02-18 13:04 bofhus Note Added: 0012611
2018-03-01 16:20 francis Changeset attached => sogo master d49219ce
2018-03-01 16:20 francis Assigned To => francis
2018-03-01 16:20 francis Resolution open => fixed
2018-03-01 16:21 francis Note Added: 0012622
2018-03-01 16:21 francis Status new => resolved
2018-03-01 16:21 francis Fixed in Version => 4.0.0