Bug 1561691 - Creating user with hammer having authentication source LDAP/AD should not ask for password [NEEDINFO]
Summary: Creating user with hammer having authentication source LDAP/AD should not ask...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: LDAP
Version: 6.3.0
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Released
Assignee: Daniel Lobato Garcia
QA Contact: Nikhil Kathole
URL:
Whiteboard:
: 1627830 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-28 17:17 UTC by Diksha Chaudhari
Modified: 2019-10-07 17:18 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:37:00 UTC
jbhatia: needinfo? (dlobatog)


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:1222 None None None 2019-05-14 12:37:12 UTC
Foreman Issue Tracker 24301 None None None 2018-07-19 11:45:25 UTC
Red Hat Knowledge Base (Solution) 3402741 None None None 2018-05-16 05:53:07 UTC

Description Diksha Chaudhari 2018-03-28 17:17:01 UTC
Description of problem:
When creating a user on satellite 6.3 with hammer having external authentication source LDAP/AD gives an error if password not mentioned while the user gets added if password parameter is mentioned. As the user created will be authenticated with the authentication source password and not by the password provided by us while creating user, iit should not be mandatory to create user with password parameter.

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

How reproducible: Always

Steps to Reproduce:
Create user without password parameter:
# hammer user create --auth-source-id 3   --firstname Tom --lastname Mathew   --login tom123 --mail 'tom@example.com' --roles 'Access Insights Viewer,Customized Viewer,Red Hat Access Logs,Tasks Reader,View hosts' 
Could not create the user:
  Missing arguments for 'user[password]'        

      2)  Create user with password parameter:
 # hammer user create --auth-source-id 3   --firstname Tom --lastname Mathew   --login tom123 --mail 'tom@example.com' --roles 'Access Insights Viewer,Customized Viewer,Red Hat Access Logs,Tasks Reader,View hosts' --password "redhat"
User [cmn01] created       

# hammer user list 
---|---------------|------------------|------------------------|-------|---------------------|--------------
ID | LOGIN         | NAME             | EMAIL                  | ADMIN | LAST LOGIN          | AUTHORIZED BY
---|---------------|------------------|------------------------|-------|---------------------|--------------
7  | tom123        |Tom Mathew        | tom@example.com        | yes   | 2018/02/20 15:21:56 | adserver    

Actual results:
User is not allowed to create without password parameter even when we have specified the external auth source. 

Expected results:
When the user is authenticated with the external authentication source LDAP/AD then while creating a user via hammer the --password parameter should be optional.


Additional info:

Comment 3 Daniel Lobato Garcia 2018-07-19 11:45:23 UTC
Created redmine issue https://projects.theforeman.org/issues/24301 from this bug

Comment 6 Daniel Lobato Garcia 2018-08-28 21:51:10 UTC
Fix submitted, AFAIK there are no 100% proven workarounds other than creating the user in the UI. 

https://github.com/theforeman/foreman/pull/6005 

It might be possible to create an user in the internal auth source, with an useless password, then update the user's auth source to be external as a workaround.

Comment 7 pm-sat@redhat.com 2018-09-01 14:17:38 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24301 has been resolved.

Comment 9 Marek Hulan 2018-09-12 05:46:15 UTC
*** Bug 1627830 has been marked as a duplicate of this bug. ***

Comment 15 Nikhil Kathole 2018-12-18 12:52:49 UTC
VERIFIED

Version tested:
Satellite 6.5 snap 8

# hammer user create --auth-source-id 15   --firstname Tom --lastname Mathew   --login tom --mail 'tom@example.com' --roles 'View hosts' 
User [tom] created.
]# hammer -u Tom -p wrong-password host list
Unable to authenticate user Tom
# hammer -u Tom -p changeme host list
---|------|------------------|------------|----|-----|---------------|--------------|----------------------
ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | GLOBAL STATUS | CONTENT VIEW | LIFECYCLE ENVIRONMENT
---|------|------------------|------------|----|-----|---------------|--------------|----------------------


User is allowed to create without passing --password if auth source is used and successfully authenticate it from auth source.

Comment 18 errata-xmlrpc 2019-05-14 12:37:00 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-2019:1222


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