Bug 1442791 - get_user_object does not exist error durring authentication process for setup that does not pull groups from ldap
Summary: get_user_object does not exist error durring authentication process for setup...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.6.0
Hardware: All
OS: All
medium
low
Target Milestone: GA
: 5.9.0
Assignee: Joe Vlcek
QA Contact: Matt Pusateri
URL:
Whiteboard: auth:miqldap:ad:freeipa:openldap
: 1443442 1445405 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-17 14:36 UTC by Felix Dewaleyne
Modified: 2021-09-09 12:15 UTC (History)
9 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-01 13:11:36 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Example setting get user groups from ldap (235.76 KB, image/png)
2017-07-11 18:34 UTC, Joe Vlcek
no flags Details
Example unsetting get user groups from ldap (205.33 KB, image/png)
2017-07-11 18:35 UTC, Joe Vlcek
no flags Details
User bill with full Distinguished name (374.51 KB, image/png)
2017-10-16 20:21 UTC, Joe Vlcek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0380 0 normal SHIPPED_LIVE Moderate: Red Hat CloudForms security, bug fix, and enhancement update 2018-03-01 18:37:12 UTC

Description Felix Dewaleyne 2017-04-17 14:36:42 UTC
Description of problem:


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

How reproducible:
all the time in customer environment

Steps to Reproduce:
1. configure binding to the ldap in cloudforms
2. do not enable group binding, instead use a custom group
3. log in as user of the ldap

Actual results:
INFO -- : MIQ(MiqLdap#bind) Binding to LDAP: Host: [10.11.12.13], User: [uid=toto,ou=people,dc=example,dc=com]...
INFO -- : MIQ(MiqLdap#bind) Binding to LDAP: Host: [10.11.12.13], User: [uid=toto,ou=people,dc=example,dc=com]... successful
<AuditSuccess> MIQ(Authenticator.authenticate) userid: [toto] - User uid=toto,ou=people,dc=example,dc=com successfully validated by LDAP
ERROR -- : [NoMethodError]: undefined method `get_user_object' for #<Authenticator::Ldap:0x00000004f9aae8>  Method:[rescue in authenticate]
ERROR -- : /var/www/miq/vmdb/app/models/authenticator/ldap.rb:53:in `create_user_from_ldap'

the user is then unable to log in with an authentication error, but the password is correct.

Expected results:
user able to log in

Additional info:

Comment 18 Joe Vlcek 2017-07-11 18:34:36 UTC
Created attachment 1296407 [details]
Example setting get user groups from ldap

Comment 19 Joe Vlcek 2017-07-11 18:35:18 UTC
Created attachment 1296408 [details]
Example unsetting get user groups from ldap

Comment 21 Joe Vlcek 2017-07-17 13:41:48 UTC
*** Bug 1445405 has been marked as a duplicate of this bug. ***

Comment 22 Joe Vlcek 2017-07-25 13:36:43 UTC
I have root caused the failure and am working on a fix. There are multiple possible solutions. I need to evaluate which solution will be best before posting a PR

Comment 24 CFME Bot 2017-08-11 14:26:33 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c045affcd6984e7539089fddf4d518e286799738

commit c045affcd6984e7539089fddf4d518e286799738
Author:     Joe VLcek <jvlcek>
AuthorDate: Wed Jul 26 15:59:54 2017 -0400
Commit:     Joe VLcek <jvlcek>
CommitDate: Wed Jul 26 15:59:54 2017 -0400

    If userid in UPN or DN format not found try simple username
    
    When not getting groups from LDAP the user is manually created in
    the DB. It is unlikely the admin will create the user in the UPN
    or DN formats as return from searching the directory. So this PR
    will also try to find the user by simple username.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1442791

 app/models/authenticator/ldap.rb       | 14 ++++++++++++++
 spec/models/authenticator/ldap_spec.rb | 14 ++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

Comment 25 Joe Vlcek 2017-10-09 17:52:24 UTC
*** Bug 1443442 has been marked as a duplicate of this bug. ***

Comment 26 Matt Pusateri 2017-10-16 19:51:55 UTC
Tested 5.9.0.2. Openldap While the error message "get_user_object" is now not in the logs, what happens is User is authenticated via ldap, but now we get the " User authenticated but not defined in EVM, please contact your EVM administrator"

I tested this two ways.

1. Created a custom group called "marketing", assigned a role to it and created user bill and gave him the marketing group.  - login failed.
2. Gave bill a default group of evm-administrator - login still failed.

Going to set this back to assigned as login doesn't work.

Comment 28 Joe Vlcek 2017-10-16 20:18:01 UTC
This fails because when not getting groups from LDAP the user must be created  in the exact way it is to match from LDAP.

In this case "User Type" is set to "Distinguished Name (UID=<user>)"

Therefore the user must be created with the full DN 
"uid=bill,ou=people,ou=prod,dc=example,dc=com"

Comment 29 Joe Vlcek 2017-10-16 20:21:10 UTC
Created attachment 1339437 [details]
User bill with full Distinguished name

Comment 31 Matt Pusateri 2017-10-17 18:26:17 UTC
Verified: 5.9.0.2 - properly entered user of uid=bill,ou=people,ou=prod,dc=psavrocks,dc=com can log in.

Comment 34 errata-xmlrpc 2018-03-01 13:11:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0380


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