Bug 842854

Summary: not able to login using the user created with the cli
Product: [Retired] Pulp Reporter: Preethi Thomas <pthomas>
Component: user-experienceAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.0.6CC: cperry, jason.dobies, jortel
Target Milestone: ---Keywords: Triaged
Target Release: Sprint 38   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-09 17:07:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Preethi Thomas 2012-07-24 18:10:45 UTC
Description of problem:
Authentication failure when trying to login using the user created with the cli

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


How reproducible:


Steps to Reproduce:
1.create a user with pulp cli
2. logout from the admin
3. try to login using the newly created user
  
Actual results:

[root@pulp-f16 ~]# pulp-admin login -u test -p redhat
Authentication failed.

Use the login command to authenticate with the server and download a session
certificate for use in future calls to this script. If credentials were
specified, please double check the username and password and attempt the request
again.


Expected results:


Additional info:

admin.log
2012-07-24 14:04:02,089 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 470, in run
    Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 792, in run
    exit_code = command_or_section.execute(remaining_args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 168, in execute
    self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/pulp/admin/extensions/pulp_admin_auth/pulp_cli.py", line 48, in login
    certificate = self.context.server.actions.login(username, password).response_body
  File "/usr/lib/python2.7/site-packages/pulp/bindings/actions.py", line 32, in login
    return self.server.POST(path)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 87, in POST
    return self._request('POST', path, body=body)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 111, in _request
    self._handle_exceptions(response_code, response_body)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 129, in _handle_exceptions
    raise code_class_mappings[response_code](response_body)
PermissionsException: Permission Denied

Comment 1 Sayli Karmarkar 2012-07-24 23:34:28 UTC
commit 88d44b506c60c9455305936ec260bcb98501cf14
Author: Sayli Karmarkar <skarmark>
Date:   Tue Jul 24 13:40:04 2012 -0700

    842854 - updated automatic user permissions to v2 resources and added v2/actions/ so that user can login and update successfully

Comment 2 Jeff Ortel 2012-07-25 01:22:45 UTC
build: 0.318.

Comment 3 Preethi Thomas 2012-07-25 13:34:22 UTC
verified
[root@preethi-el6-pulp ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.318-1.el6.noarch

user is able to login with a non admin userid. Although please note that no other cli commands work with non admin user. You will get Authentication Failed error and permission error in admin.log

[root@preethi-el6-pulp ~]# pulp-admin login -u preethi  -p redhat
Successfully logged in. Session certificate will expire at Aug  1 13:25:26 2012
GMT.

Comment 4 Sayli Karmarkar 2012-07-26 21:38:49 UTC
Preethi, The only thing this user will be able to do is update itself. That and logout are the only default permissions given to a user. To get other permissions, user either needs to be added to a particular role or explicitly given permissions (through api as there is no cli support for that yet).

Comment 5 Preethi Thomas 2013-01-09 17:07:21 UTC
Pulp v2.0 released