Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1326319

Summary: oc delete user makes user unable to log in again
Product: OpenShift Container Platform Reporter: Evgheni Dereveanchin <ederevea>
Component: apiserver-authAssignee: Jordan Liggitt <jliggitt>
Status: CLOSED ERRATA QA Contact: weiwei jiang <wjiang>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: aos-bugs, jliggitt, tdawson, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 16:35:55 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 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