Bug 1704856

Summary: Unexpected (no-op) results when updating htpasswd
Product: OpenShift Container Platform Reporter: jolee
Component: apiserver-authAssignee: Erica von Buelow <evb>
Status: CLOSED NOTABUG QA Contact: Chuan Yu <chuyu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: aos-bugs, chuffman, mkhan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-30 18:07:31 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:
Bug Depends On:    
Bug Blocks: 1664187    

Description jolee 2019-04-30 16:42:55 UTC
Description of problem:

Updating after initial walk thru of:
https://docs.openshift.com/container-platform/4.1/authentication/identity_providers/configuring-htpasswd-identity-provider.html#identity-provider-overview-configuring-htpasswd-identity-provider

deleting the secret and recreating appears to be a no-op


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


How reproducible:


Steps to Reproduce:

[jolee@leep50 Downloads]$ oc get users
NAME      UID                                    FULL NAME   IDENTITIES
jolee     dfd9dbe9-66bd-11e9-98b4-0a580a820032               htpasswd:jolee

[jolee@leep50 Downloads]$ htpasswd -b users.htpasswd jolee "2[(EXk&A/{(("
Adding password for user jolee

[jolee@leep50 Downloads]$ htpasswd -b users.htpasswd project-lead "2[(EXk&A/{(("
Adding password for user project-lead

[jolee@leep50 Downloads]$ cat users.htpasswd 
project-dev:$2y$05$K/maIPTxMsa8NtVe4c81bOejGkvK4Yptdww.7BbbM5M/CZ7FBsUT.
jolee:$apr1$4nWIWCA.$I03ZXJDqHqhXDwivQjgd5/
project-lead:$apr1$IOkPYhiU$ZCkz00zINlXPFSO.Dfx/O1

[jolee@leep50 Downloads]$ oc delete secret htpass-secret -n openshift-config
secret "htpass-secret" deleted

[jolee@leep50 Downloads]$ oc describe secret htpass-secret -n openshift-config
Error from server (NotFound): secrets "htpass-secret" not found

[jolee@leep50 Downloads]$ oc create secret generic htpass-secret --from-file=users.htpasswd -n openshift-config
secret/htpass-secret created

[jolee@leep50 Downloads]$ oc describe secret htpass-secret -n openshift-config
Name:         htpass-secret
Namespace:    openshift-config
Labels:       <none>
Annotations:  <none>

Type:  Opaque

Data
====
users.htpasswd:  168 bytes

[jolee@leep50 Downloads]$ oc get users
NAME      UID                                    FULL NAME   IDENTITIES
jolee     dfd9dbe9-66bd-11e9-98b4-0a580a820032               htpasswd:jolee


Actual results:


Expected results:


Additional info:

Comment 1 Mo 2019-04-30 18:07:31 UTC
This is working as expected.  User objects are only created when the user actually logs in.

Comment 2 jolee 2019-04-30 18:10:32 UTC
I only pursued this after failing to initially log in as one of the "extra" users.  Not sure if additional review is needed.

Comment 3 Mo 2019-05-01 11:11:16 UTC
The key on the secret is incorrect.  It must be htpasswd

Comment 4 Christian Huffman 2019-05-01 19:11:37 UTC
I updated the documentation to make this key name more obvious for the HTPasswd and LDAP IDPs. This was done under https://github.com/openshift/openshift-docs/pull/14621 .