{"id":4573,"date":"2021-01-11T12:46:54","date_gmt":"2021-01-10T23:46:54","guid":{"rendered":"http:\/\/www.zoyinc.com\/?p=4573"},"modified":"2023-07-09T19:28:25","modified_gmt":"2023-07-09T07:28:25","slug":"reinstate-deleted-user-okd-4-5","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=4573","title":{"rendered":"Reinstate deleted user OKD 4.5"},"content":{"rendered":"\n<p>I had an OKD 4.5 user which authenticated against htpasswd. This user was a member of a group and admin role binding.<\/p>\n\n\n\n<p>I then deleted the user through the web console:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><a  href=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser01.jpg\" class=\"thickbox no_icon\" title=\"\"><img loading=\"lazy\" decoding=\"async\" width=\"874\" height=\"473\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser01.jpg\" alt=\"\" class=\"wp-image-4574\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser01.jpg 874w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser01-300x162.jpg 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser01-150x81.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser01-768x416.jpg 768w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser01-500x271.jpg 500w\" sizes=\"auto, (max-width: 874px) 100vw, 874px\" \/><\/a><\/figure>\n\n\n\n<p>The problem came when I wanted to re-enable the user.<\/p>\n\n\n\n<p>Adding a user in OKD involves adding an authentication mechanism, IDP, such as htpasswd, LDAP or Google. Then when the user logged in their name appeared in the list of users &#8211; albeit without any access.<\/p>\n\n\n\n<p>So when I tried to login as the deleted user it wouldn&#8217;t let me giving me an &#8220;authentication error&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"354\" height=\"151\" src=\"https:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser02.jpg\" alt=\"\" class=\"wp-image-4575\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser02.jpg 354w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser02-300x128.jpg 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2021\/01\/ReinstateDeletedUser02-150x64.jpg 150w\" sizes=\"auto, (max-width: 354px) 100vw, 354px\" \/><\/figure>\n\n\n\n<p>There doesn&#8217;t seem to be any obvious way to fix the issue. Certainly I could not find anything in the web console.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Solution<\/h1>\n\n\n\n<p>The solution turned out to be really simple. From a command line and logged in as an oc user with admin rights run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">oc delete identity htpasswd:admin<\/pre>\n\n\n\n<p>The name of the user is &#8220;admin&#8221; and the authentication mechanism is &#8220;htpasswd&#8221;.<\/p>\n\n\n\n<p>After doing the above the user appeared in the list of users and could be added to groups etc.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>I had an OKD 4.5 user which authenticated against htpasswd. This user was a member of a group and admin role binding. I then deleted the user through the web console: The problem came when I wanted to re-enable the user. Adding a user in OKD involves adding an authentication mechanism, IDP, such as htpasswd, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":5486,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[796,677],"tags":[695,98,694,696,668,700,679,678,698,697,701,693,699],"class_list":["post-4573","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home-page","category-openshift-okd","tag-add","tag-delete","tag-deleted","tag-enable","tag-fix","tag-group","tag-okd","tag-openshift","tag-re-enable","tag-reenable","tag-role","tag-user","tag-user-management"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/4573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4573"}],"version-history":[{"count":5,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/4573\/revisions"}],"predecessor-version":[{"id":5448,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/4573\/revisions\/5448"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/media\/5486"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4573"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}