Bug 1704856 - Unexpected (no-op) results when updating htpasswd
Summary: Unexpected (no-op) results when updating htpasswd
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: apiserver-auth
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Erica von Buelow
QA Contact: Chuan Yu
URL:
Whiteboard:
Depends On:
Blocks: 1664187
TreeView+ depends on / blocked
 
Reported: 2019-04-30 16:42 UTC by jolee
Modified: 2019-05-01 19:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-30 18:07:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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 .


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