Bug 1326319 - oc delete user makes user unable to log in again
Summary: oc delete user makes user unable to log in again
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: apiserver-auth
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Jordan Liggitt
QA Contact: weiwei jiang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-12 12:08 UTC by Evgheni Dereveanchin
Modified: 2019-10-10 11:50 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 16:35:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1064 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 3.2 security, bug fix, and enhancement update 2016-05-12 20:19:17 UTC

Description Evgheni Dereveanchin 2016-04-12 12:08:58 UTC
Description of problem:
issuing "oc delete user" causes the username to be invalid forever. When attempting to log in, an error pops up instead of creating a fresh user with no permissions

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

How reproducible:
Always

Steps to Reproduce:
1. simple htpasswd setup (works with other auth providers as well)
2. create a user
htpasswd /etc/origin/openshift-htpasswd deleteme
3. log in as deleteme into the WebUI
4. log out
5. delete user
oc delete user deleteme
oc delete group deleteme
6. try to log into the WebUI again

Actual results:
An unknown error has occurred. Please try again.

Expected results:
User logs in and a fresh profile is assigned

Additional info:

error on Master:

Apr 12 14:00:42 master.demo.lan atomic-openshift-master[28137]: E0412 14:00:42.972098 28137 login.go:141] Unable to authenticate password: Error creating or updating mapping for: &api.DefaultUserIdentityInfo{ProviderName:"my_htpasswd_provider", ProviderUserName:"deleteme", Extra:map[string]string{}} due to users "deleteme" not found

Comment 1 Jordan Liggitt 2016-04-12 12:32:23 UTC
You need to remove the identity as well. Deleting just the user leaves the identity in place referencing a user that no longer exists.

Comment 3 Jordan Liggitt 2016-04-12 14:10:21 UTC
The name of the identity is a combination of the identity provider name (as configured in the master-config.yaml) and the provider user name.

In the example above, the identity name would be "my_htpasswd_provider:deleteme"

Comment 4 Evgheni Dereveanchin 2016-04-12 14:13:37 UTC
Thanks, that works. I think we need to document this properly to avoid confusion on what has to be removed and what "oc delete user" is actually good for if it does not remove the user completely.

Comment 5 weiwei jiang 2016-04-13 03:31:59 UTC
Since the failed login is by design, so verify this.

Comment 6 Evgheni Dereveanchin 2016-04-13 06:13:35 UTC
If this is by design - the "An unknown error has occurred. Please try again." message should not appear in the UI and E0412 should not appear in logs. This must all be handled properly.

Comment 7 Jordan Liggitt 2016-04-13 06:31:43 UTC
We intentionally do not provide details about internal user configuration to unauthenticated users. We can improve the server log message.

Comment 9 errata-xmlrpc 2016-05-12 16:35:55 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-2016:1064


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