RHOCP 4 Cluster Login Failure for Specific User
Environment
-
Red Hat OpenShift Container Platform (RHOCP)
- 4
-
Red Hat OpenShift Service on AWS (ROSA)
-
Red Hat OpenShift Dedicated 4 (OSD)
- 4
-
Azure Red Hat OpenShift (ARO)
- 4
Issue
-
A particular user is
unabletologininto theclustereven if the user is present in theIDP. -
How to reclaim an accidentally deleted user in Red Hat OpenShift?
-
A user cannot login after being deleted from the Red Hat OpenShift
web consoleto switch to a differentauthentication system, displaying the following error in theOAuthlogs:Error authenticating "<username>" with provider "<provider>": users.user.openshift.io "<username>" not found.
Resolution
-
To reclaim the accidentally deleted
user, remove theleftover identityfor theuser:$ oc delete identity <identity_name> -
Once the associated
identityis deleted, try to login again with the sameuserso that theuserand theidentityshould be created and mapped automatically with the login attempt.$ oc delete identity htpasswd_auth:demo
Root Cause
-
RHOCPdecouplesuser configuration into two distinct objects:userandidentity.-
To get the current list of
users:# oc get user NAME UID FULL NAME IDENTITIES demo 75e4b80c-xxxxxxxxxx htpasswd_auth:demo -
To get the current list of
identities:# oc get identity NAME IDP NAME IDP USER NAME USER NAME USER UID htpasswd_auth:demo htpasswd_auth demo demo 75e4b80c-xxxxxxxxxx
-
-
Authenticationfails if theuserobject is deleted but the associatedidentityremains. Therefore, to completely remove a user, the associatedidentitymust also be deleted.
Diagnostic Steps
-
Check the
oauthpod logs to identify the reason behind failedlogin.# oc get pod -l app=oauth-openshift -n openshift-authentication NAME READY STATUS RESTARTS AGE oauth-openshift-xxxxxxxxxx-xxxxx 1/1 Running 0 20d oauth-openshift-xxxxxxxxxx-yyyyy 1/1 Running 0 7d3h oauth-openshift-xxxxxxxxxx-zzzzz 1/1 Running 0 20d # oc logs -n openshift-authentication oauth-openshift-xxxxxxxxxx-xxxxx | grep <username> E0614 16:11:58.572096 1 errorpage.go:28] AuthenticationError: users.user.openshift.io "<username>" not found -
Verify if the user is present in the cluster by listing the existing
users:# oc get users | grep <username> -
Verify if the
identityobject associated with thatusernameis present in the cluster:# oc get identity | grep <username> NAME IDP NAME IDP USER NAME USER NAME USER UID htpasswd_auth:demo htpasswd_auth demo demo 75e4b80c-dbf1-11e5-8dc6-0e81e52cc949
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments