Bug 1448787 - Duplicated users when changed the (upper,lower)case of letters of login name
Summary: Duplicated users when changed the (upper,lower)case of letters of login name
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.0
Assignee: Joe Vlcek
QA Contact: Matt Pusateri
URL:
Whiteboard: auth:externalauth:ad:rbac
Depends On:
Blocks: 1480654
TreeView+ depends on / blocked
 
Reported: 2017-05-08 07:04 UTC by Gellert Kis
Modified: 2020-12-14 08:37 UTC (History)
13 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1480654 (view as bug list)
Environment:
5.7.2.1
Last Closed: 2018-03-06 15:08:22 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gellert Kis 2017-05-08 07:04:25 UTC
Description of problem:

If the user enters his username with different registers of letters, the user is duplicated in the CFME UI. The screenshot in the attachment.

The screenshot in the attachment.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Gellert Kis 2017-05-08 07:20:14 UTC
I think this is fixed in upstream , 
if I try to add a new user with different capital username, but same fullname , I get a message "Userid is not unique within region 0"

Comment 8 Matt Pusateri 2017-06-09 12:38:37 UTC
Seems similar to: https://bugzilla.redhat.com/show_bug.cgi?id=1424618

Comment 12 Joe Vlcek 2017-07-25 21:13:29 UTC
Gellert,

I have tried but I am not able to reproduce this. An easy work around is to have the users login with the same spelling, with matching case, each time.

To help me diagnose what is going wrong please provide:

- a screenshot of the Configuration/Authentication page.
- Please tar up and attach the contents of the log directory at: /var/www/miq/vmdb/log
- Please attach the file /etc/sssd/sssd.conf

Thank you, JoeV

Comment 13 Joe Vlcek 2017-07-25 21:22:10 UTC
Gellert,

Please also confirm the CFME version where the failure is observed.

Thank you, JoeV

Comment 25 CFME Bot 2017-08-07 18:46:19 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/88a312c28a8825624bcfed14a1c0ea67edbe9518

commit 88a312c28a8825624bcfed14a1c0ea67edbe9518
Author:     Joe VLcek <jvlcek>
AuthorDate: Wed Aug 2 17:30:37 2017 -0400
Commit:     Joe VLcek <jvlcek>
CommitDate: Wed Aug 2 18:17:00 2017 -0400

    Normalize the username entered at login to lowercase
    
    LDAP does a case sensitive match of the user name but AD will
    do a case insensitive match. By normalizing the userid to
    lowercase when using external auth both backed to either
    an LDAP directory or AD both will authenticate but only one DB
    record, in all lowercase, will be created, even if the user
    attempted to login with a mixed case username when backed to AD.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1448787

 app/models/authenticator/base.rb        |  2 +-
 spec/models/authenticator/httpd_spec.rb | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

Comment 28 CFME Bot 2017-08-11 19:01:16 UTC
New commit detected on ManageIQ/manageiq/fine:
https://github.com/ManageIQ/manageiq/commit/344df3acf370e5f852bfd4772b4b67dcc2649d69

commit 344df3acf370e5f852bfd4772b4b67dcc2649d69
Author:     Joe VLcek <jvlcek>
AuthorDate: Wed Aug 2 17:30:37 2017 -0400
Commit:     Joe VLcek <jvlcek>
CommitDate: Fri Aug 11 13:27:17 2017 -0400

    Normalize the username entered at login to lowercase
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1480654
    
    This is a cherry pick from 88a312c28a
    The cherry pick was not clean and had to be finished manually due to layout change of affected files.
    
    LDAP does a case sensitive match of the user name but AD will
    do a case insensitive match. By normalizing the userid to
    lowercase when using external auth both backed to either
    an LDAP directory or AD both will authenticate but only one DB
    record, in all lowercase, will be created, even if the user
    attempted to login with a mixed case username when backed to AD.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1448787

 app/models/authenticator.rb             | 10 ++++++--
 spec/models/authenticator/httpd_spec.rb | 44 +++++++++++++++++++++++++++------
 2 files changed, 44 insertions(+), 10 deletions(-)

Comment 29 Matt Pusateri 2017-10-12 21:52:07 UTC
Works in MIQLDAP - AD Will test external auth as well

Comment 30 ITD27M01 2017-10-27 08:32:40 UTC
Please pay attention about updates. Installations can have already populated database by uppercased userid. After update users will not able to login.

Comment 31 Joe Vlcek 2017-10-27 13:13:20 UTC
(In reply to ITD27M01 from comment #30)
> Please pay attention about updates. Installations can have already populated
> database by uppercased userid. After update users will not able to login.

We do our best to avoid this but there are unfortunately some conditions where users will need to user the CFME UI to remove unneeded users.

Comment 32 ITD27M01 2017-10-27 13:33:23 UTC
Bad things because there is automation methods that related to userid. As an example VM retirement emails:

https://github.com/ManageIQ/manageiq-content/blob/fine/content/automate/ManageIQ/Cloud/VM/Retirement/Email.class/__methods__/vm_retirement_emails.rb#L43

Comment 33 ITD27M01 2017-10-27 13:40:14 UTC
My be you can create SQL procedure to update vmdb and switch userid to downcase ?

~~~~~~~~~~~~~~~~~~~~~~~
vmdb_production=# select id,name,userid from users where userid='Igor.Tiunov';
 id  |     name     |   userid
-----+--------------+-------------
 109 | Tiunov, Igor | Igor.Tiunov
~~~~~~~~~~~~~~~~~~~~~~~

Comment 34 Joe Vlcek 2017-10-27 14:31:39 UTC
(In reply to ITD27M01 from comment #33)
> My be you can create SQL procedure to update vmdb and switch userid to
> downcase ?
> 
> ~~~~~~~~~~~~~~~~~~~~~~~
> vmdb_production=# select id,name,userid from users where
> userid='Igor.Tiunov';
>  id  |     name     |   userid
> -----+--------------+-------------
>  109 | Tiunov, Igor | Igor.Tiunov
> ~~~~~~~~~~~~~~~~~~~~~~~

Yes we do downcase the userid

The issue is what if the following already exists:

userid:
Bob
BOb
BOB

If we downcase Bob to bob then we have:

userid:
bob
BOb
BOB

Leaving BOb and BOB, which would be unused and need to be manually cleaned up
by the administrator. I don't want to delete BOb and BOB in this case. I would rather let the administrator clean you the ones not wanted and leave the only one, which would we would auto-down-case

Comment 35 ITD27M01 2017-10-27 15:00:40 UTC
Now I understand you. It is what I need.

Comment 36 Joe Vlcek 2017-10-30 19:52:46 UTC
Per discussion w/MattP moving back to ON_DEV

Comment 37 Joe Vlcek 2017-10-31 21:38:15 UTC
Per conversation with MattP moving back to ON_QA as by default sssd does case sensitive user matching. In order to do case insensitive with SSSD "case_sensitive = False" needs to be added to the domain section of the sssd.conf

See: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/6.3_technical_notes/sssd section: BZ#735827

JoeV

Comment 38 Matt Pusateri 2018-01-22 21:12:59 UTC
Verified: 5.9.0.17


Note You need to log in before you can comment on or make changes to this bug.