Bug 1471099 - stored credentials should be mutually exclusive with auth sessions
stored credentials should be mutually exclusive with auth sessions
Status: VERIFIED
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity medium (vote)
: Beta
: --
Assigned To: Tomas Strachota
Peter Ondrejka
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-14 08:23 EDT by Peter Ondrejka
Modified: 2017-10-02 05:23 EDT (History)
4 users (show)

See Also:
Fixed In Version: hammer-cli-foreman 0.11
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 20315 None None None 2017-07-17 05:20 EDT

  None (edit)
Description Peter Ondrejka 2017-07-14 08:23:46 EDT
Description of problem:

If .hammer/cli.modules.d/foreman.yml has username and password specified as well as use_sessions enabled, the stored credentials will take precedence over the session.

If you specify ":use_sessions: true" and don't erase username/password, you'll see:

~]# hammer -u admin2 -p changeme organization list
...

~]# hammer auth status
Session exist, currently logged in as 'admin2'

~]# hammer organization list
...

~]# hammer auth status
Session exist, currently logged in as 'admin'

So after running "hammer organization list" the session is reset to what is specified in the file.

Also if you specify just username in the file, you are prompted for password on a command run, but it creates problems when attempting to change session to a different user:

~]# hammer -u admin2 -p changeme organization list
...

~]# hammer auth status
Session exist, currently logged in as 'admin2'

~]# hammer organization list
[Foreman] Password for admin:
Comment 1 Tomas Strachota 2017-07-17 05:20:24 EDT
Created redmine issue http://projects.theforeman.org/issues/20315 from this bug
Comment 3 pm-sat@redhat.com 2017-07-21 10:14:18 EDT
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20315 has been resolved.
Comment 4 Brad Buckingham 2017-09-12 11:06:07 EDT
Moving to Beta at QE request, since this is related to a 6.3 feature.
Comment 5 Peter Ondrejka 2017-10-02 05:23:57 EDT
Verified in satellite-6.3.0-19.0.beta.el7sat.noarch

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