Skip to content

Commit 05d520b

Browse files
committed
BZ-1682962: Updated htpasswd instructions.
1 parent 96147aa commit 05d520b

File tree

4 files changed

+75
-15
lines changed

4 files changed

+75
-15
lines changed

authentication/identity_providers/configuring-htpasswd-identity-provider.adoc

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,35 @@ include::modules/common-attributes.adoc[]
44
:context: configuring-htpasswd-identity-provider
55
toc::[]
66

7-
Configure the `htpasswd` identity provider to validate user names and passwords
8-
against a flat file generated using
9-
link:http://httpd.apache.org/docs/2.4/programs/htpasswd.html[`htpasswd`].
7+
[id="identity-provider-overview-{context}"]
8+
== About identity providers in {product-title}
109

11-
include::modules/identity-provider-overview.adoc[leveloffset=+1]
10+
By default, only a `kubeadmin` user exists on your cluster. To specify an
11+
identity provider, you must create a Custom Resource (CR) that describes
12+
that identity provider and add it to the cluster.
1213

13-
include::modules/identity-provider-creating-htpasswd-file.adoc[leveloffset=+1]
14+
[NOTE]
15+
====
16+
{product-title} user names containing `/`, `:`, and `%` are not supported.
17+
====
18+
19+
To define an HTPasswd identity provider you must perform the
20+
following steps:
21+
22+
. Create an `htpasswd` file to store the user and password information.
23+
Instructions are provided for
24+
xref:../../authentication/identity_providers/configuring-htpasswd-identity-provider.adoc#identity-provider-creating-htpasswd-file-linux-{context}[Linux]
25+
and
26+
xref:../../authentication/identity_providers/configuring-htpasswd-identity-provider.adoc#identity-provider-creating-htpasswd-file-windows-{context}[Windows].
27+
. xref:../../authentication/identity_providers/configuring-htpasswd-identity-provider.adoc#identity-provider-creating-htpasswd-secret-{context}[Create
28+
an {product-title} secret to represent the `htpasswd` file].
29+
. xref:../../authentication/identity_providers/configuring-htpasswd-identity-provider.adoc#identity-provider-htpasswd-CR-{context}[Define the HTPasswd identity provider resource].
30+
. xref:../../authentication/identity_providers/configuring-htpasswd-identity-provider.adoc#add-identity-provider-{context}[Apply the resource to
31+
the default OAuth configuration].
32+
33+
include::modules/identity-provider-creating-htpasswd-file-linux.adoc[leveloffset=+1]
34+
35+
include::modules/identity-provider-creating-htpasswd-file-windows.adoc[leveloffset=+1]
1436

1537
include::modules/identity-provider-htpasswd-secret.adoc[leveloffset=+1]
1638

modules/identity-provider-creating-htpasswd-file.adoc renamed to modules/identity-provider-creating-htpasswd-file-linux.adoc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@
22
//
33
// * authentication/identity_providers/configuring-htpasswd-identity-provider.adoc
44

5-
[id="identity-provider-creating-htpasswd-file-{context}"]
6-
= Creating an HTPasswd file
5+
[id="identity-provider-creating-htpasswd-file-linux-{context}"]
6+
= Creating an HTPasswd file using Linux
77

88
To use the HTPasswd identity provider, you must generate a flat file that
99
contains the user names and passwords for your cluster by using
1010
link:http://httpd.apache.org/docs/2.4/programs/htpasswd.html[`htpasswd`].
1111

12-
.Procedure
12+
.Prerequisites
1313

14-
. Install the `htpasswd` utility by installing the `httpd-tools` package:
15-
+
16-
----
17-
# yum install httpd-tools
18-
----
14+
* Have access to the `htpasswd` utility. On Red Hat Enterprise Linux
15+
this is available by installing the `httpd-tools` package.
16+
17+
.Procedure
1918

20-
. Create or update your with a user name and hashed password:
19+
. Create or update your flat file with a user name and hashed password:
2120
+
2221
----
2322
$ htpasswd -c -B -b </path/to/users.htpasswd> <user_name> <password>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * authentication/identity_providers/configuring-htpasswd-identity-provider.adoc
4+
5+
[id="identity-provider-creating-htpasswd-file-windows-{context}"]
6+
= Creating an HTPasswd file using Windows
7+
8+
To use the HTPasswd identity provider, you must generate a flat file that
9+
contains the user names and passwords for your cluster by using
10+
link:http://httpd.apache.org/docs/2.4/programs/htpasswd.html[`htpasswd`].
11+
12+
.Prerequisites
13+
14+
* Have access to `htpasswd.exe`. This file is included in the `\bin`
15+
directory of many Apache httpd distributions.
16+
17+
.Procedure
18+
19+
. Create or update your flat file with a user name and hashed password:
20+
+
21+
----
22+
> htpasswd.exe -c -B -b <\path\to\users.htpasswd> <user_name> <password>
23+
----
24+
+
25+
The command generates a hashed version of the password.
26+
+
27+
For example:
28+
+
29+
----
30+
> htpasswd.exe -c -B -b users.htpasswd user1 MyPassword!
31+
32+
Adding password for user user1
33+
----
34+
35+
. Continue to add or update credentials to the file:
36+
+
37+
----
38+
> htpasswd.exe -b <\path\to\users.htpasswd> <user_name> <password>
39+
----

modules/identity-provider-htpasswd-secret.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ contains the HTPasswd user file.
1414

1515
.Procedure
1616

17-
. Create an {product-title} Secret that contains the HTPasswd users file.
17+
* Create an {product-title} Secret that contains the HTPasswd users file.
1818
+
1919
----
2020
$ oc create secret generic htpass-secret --from-file=htpasswd=</path/to/users.htpasswd> -n openshift-config

0 commit comments

Comments
 (0)