Skip to content

Commit b59ac8f

Browse files
tolushagtrivedi88
andauthored
chore: Improve installing-che-on-openshift-with-keycloak-as-oidc article (#3060)
* chore: Update installing-che-on-openshift-with-keycloak-as-oidc article Signed-off-by: Anatolii Bazko <abazko@redhat.com> * Update modules/administration-guide/pages/installing-che-on-openshift-with-keycloak-as-oidc.adoc Co-authored-by: Gaurav Trivedi <90042568+gtrivedi88@users.noreply.github.com> * Update modules/administration-guide/pages/installing-che-on-openshift-with-keycloak-as-oidc.adoc Co-authored-by: Gaurav Trivedi <90042568+gtrivedi88@users.noreply.github.com> * Update modules/administration-guide/pages/installing-che-on-openshift-with-keycloak-as-oidc.adoc Co-authored-by: Gaurav Trivedi <90042568+gtrivedi88@users.noreply.github.com> * Update modules/administration-guide/pages/installing-che-on-openshift-with-keycloak-as-oidc.adoc Co-authored-by: Gaurav Trivedi <90042568+gtrivedi88@users.noreply.github.com> * Update modules/administration-guide/pages/installing-che-on-openshift-with-keycloak-as-oidc.adoc Co-authored-by: Gaurav Trivedi <90042568+gtrivedi88@users.noreply.github.com> * fixup Signed-off-by: Anatolii Bazko <abazko@redhat.com> * fixup Signed-off-by: Anatolii Bazko <abazko@redhat.com> --------- Signed-off-by: Anatolii Bazko <abazko@redhat.com> Co-authored-by: Gaurav Trivedi <90042568+gtrivedi88@users.noreply.github.com>
1 parent 9bceaec commit b59ac8f

1 file changed

Lines changed: 12 additions & 36 deletions

File tree

modules/administration-guide/pages/installing-che-on-openshift-with-keycloak-as-oidc.adoc

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ Install {prod-short} on an OpenShift cluster that uses {keycloak} as an external
2121
+
2222
[source,shell,subs="+quotes,+attributes"]
2323
----
24-
# The {keycloak} namespace:
25-
KEYCLOAK_NAMESPACE=__<KEYCLOAK_NAMESPACE>__
26-
2724
# The {keycloak} realm used for OpenShift authentication:
28-
OPENSHIFT_REALM=<REALM>
25+
OPENSHIFT_REALM=__<REALM>__
2926
30-
# The {keycloak} URL
31-
KEYCLOAK_URL=https://$({orch-cli} get route keycloak -n $KEYCLOAK_NAMESPACE --template='{{ .spec.host }}')
27+
# The {keycloak} URL:
28+
KEYCLOAK_URL=__<KEYCLOAK_URL>__
3229
----
3330

3431
. Create a `{prod-id}` client in the {keycloak} Admin Console:
@@ -71,7 +68,7 @@ If you have multiple OIDC providers configured, adjust the array index in the pa
7168
(currently 0) to match your {keycloak} provider's position in the configuration.
7269
====
7370

74-
. Wait for the `kube-apiserver` cluster operator to roll out the configuration changes:
71+
. Wait for the `kube-apiserver` cluster Operator to roll out the configuration changes:
7572
+
7673
[source,shell,subs="+quotes,+attributes"]
7774
----
@@ -159,7 +156,7 @@ EOF
159156
<1> The claim to use for extracting user groups.
160157
<2> The prefix to add to group names. Empty string means no prefix.
161158
<3> The claim to use for extracting the username.
162-
<4> The prefix to add to usernames from the external authentication system.
159+
<4> The prefix to add to usernames. Empty string means no prefix.
163160
+
164161
[NOTE]
165162
====
@@ -180,42 +177,21 @@ These values must match the corresponding claim and prefix settings configured i
180177
--che-operator-cr-patch-yaml che-patch.yaml
181178
----
182179

183-
. Update a `{prod-id}` client to set {prod-short} callback URL:
180+
. Update the `{prod-id}` client to set the {prod-short} redirect URI and web origin:
184181
+
185-
--
186-
.. Open the {keycloak} Admin Console.
187-
.. Within the realm used for OpenShift authentication, click the `{prod-id}` client.
188-
... In the *Valid redirect URIs* field, enter the redirect URI for your {prod-short} installation. To obtain the redirect URI, run the following command:
182+
Obtain the {prod} URL with the following command:
189183
+
190184
[source,shell,subs="+quotes,+attributes"]
191185
----
192-
echo "$({orch-cli} get checluster {prod-checluster} -n {prod-namespace} -o jsonpath='{.status.cheURL}')/oauth/callback"
186+
echo "$({orch-cli} get checluster {prod-checluster} -n {prod-namespace} -o jsonpath='{.status.cheURL}')"
193187
----
188+
+
189+
--
190+
... In the *Valid redirect URIs* field, entry the URL above with `/oauth/callback` appended
191+
... In the *Web origins* field, entry the URL above.
194192
... Click *Save*.
195193
--
196194

197-
. Create a `ClusterRoleBinding` to grant users access to {prod-short}:
198-
+
199-
[source,shell,subs="+quotes,+attributes"]
200-
----
201-
{orch-cli} apply -f - <<EOF
202-
apiVersion: rbac.authorization.k8s.io/v1
203-
kind: ClusterRoleBinding
204-
metadata:
205-
name: openshift-developers
206-
roleRef:
207-
apiGroup: rbac.authorization.k8s.io
208-
kind: ClusterRole
209-
name: self-provisioner <1>
210-
subjects:
211-
- apiGroup: rbac.authorization.k8s.io
212-
kind: Group
213-
name: __<GROUP_NAME>__ <2>
214-
EOF
215-
----
216-
<1> Users must have at least the `self-provisioner` role to access {prod-short}.
217-
<2> The name of the user group from {keycloak} that should be granted access to {prod-short}.
218-
219195
.Verification
220196

221197
. Verify the {prod-short} instance status:

0 commit comments

Comments
 (0)