You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/authentication/proc-enabling-user-authentication-with-rhbk.adoc
+157-7Lines changed: 157 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
[id="enabling-authentication-with-rhbk"]
2
-
= Enabling authentication with {rhbk-brand-name} ({rhbk})
3
-
4
-
To authenticate users with {rhbk-brand-name} ({rhbk}), enable the OpenID Connect (OIDC) authentication provider in {product}.
1
+
[id="enabling-user-authentication-with-rhbk"]
2
+
= Enabling user authentication with {rhbk-brand-name} ({rhbk})
5
3
4
+
To authenticate users with {rhbk-brand-name} ({rhbk}), enable and configure the OpenID Connect (OIDC) authentication provider in {product} and provision the users and groups from {rhbk} to the {product-short} software catalog.
6
5
7
6
.Prerequisites
8
7
* You link:{configuring-book-url}[added a custom {product-short} application configuration], and have sufficient permissions to modify it.
9
8
* You have sufficient permissions in {rhsso} to create and manage a realm.
9
+
Alternatively, you can ask your {rhbk} administrator to prepare the required {rhbk} App.
10
10
11
11
.Procedure
12
12
. To allow {product-short} to authenticate with {rhbk}, complete the steps in {rhbk}, to link:https://docs.redhat.com/en/documentation/red_hat_build_of_keycloak/26.0/html/getting_started_guide/getting-started-zip-#getting-started-zip-create-a-realm[create a realm and a user] and link:https://docs.redhat.com/en/documentation/red_hat_build_of_keycloak/26.0/html/getting_started_guide/getting-started-zip-#getting-started-zip-secure-the-first-application[secure the first application]:
@@ -31,6 +31,145 @@ Save the value for the next step:
31
31
`AUTH_OIDC_CLIENT_SECRET`:: Enter the saved **Client Secret**.
32
32
`AUTH_OIDC_METADATA_URL`:: Enter the saved **{rhbk} realm base URL**.
33
33
34
+
. link:{installing-and-viewing-plugins-book-url}[Enable the `backstage-plugin-catalog-backend-module-keycloak-dynamic` plugin].
. To enable {rhbk} member discovery, edit `{my-app-config-file}`, your custom {product-short} configuration file:
45
+
+
46
+
--
47
+
[id=keycloakOrgProviderId]
48
+
.`{my-app-config-file}` fragment with mandatory `keycloakOrg` fields
49
+
[source,yaml]
50
+
----
51
+
catalog:
52
+
providers:
53
+
keycloakOrg:
54
+
default:
55
+
baseUrl: ${AUTH_OIDC_METADATA_URL}
56
+
clientId: ${AUTH_OIDC_CLIENT_ID}
57
+
clientSecret: ${AUTH_OIDC_CLIENT_SECRET}
58
+
----
59
+
60
+
`baseUrl`::
61
+
Your {rhbk} server URL, defined when xref:enabling-authentication-with-rhbk[enabling authentication with {rhbk}].
62
+
63
+
`clientId`::
64
+
Your {product-short} application client ID in {rhbk}, defined when xref:enabling-authentication-with-rhbk[enabling authentication with {rhbk}].
65
+
66
+
`clientSecret`::
67
+
Your {product-short} application client secret in {rhbk}, defined when xref:enabling-authentication-with-rhbk[enabling authentication with {rhbk}].
68
+
69
+
Optional: Consider adding the following optional fields:
70
+
71
+
`realm`::
72
+
Realm to synchronize.
73
+
Default value: `master`.
74
+
+
75
+
.`{my-app-config-file}` fragment with optional `realm` field
76
+
[source,yaml]
77
+
----
78
+
catalog:
79
+
providers:
80
+
keycloakOrg:
81
+
default:
82
+
realm: master
83
+
----
84
+
85
+
`loginRealm`::
86
+
Realm used to authenticate.
87
+
Default value: `master`.
88
+
+
89
+
.`{my-app-config-file}` fragment with optional `loginRealm` field
90
+
[source,yaml]
91
+
----
92
+
catalog:
93
+
providers:
94
+
keycloakOrg:
95
+
default:
96
+
loginRealm: master
97
+
----
98
+
99
+
`userQuerySize`::
100
+
User number to query simultaneously.
101
+
Default value: `100`.
102
+
+
103
+
.`{my-app-config-file}` fragment with optional `userQuerySize` field
104
+
[source,yaml]
105
+
----
106
+
catalog:
107
+
providers:
108
+
keycloakOrg:
109
+
default:
110
+
userQuerySize: 100
111
+
----
112
+
113
+
`groupQuerySize`::
114
+
Group number to query simultaneously.
115
+
Default value: `100`.
116
+
+
117
+
.`{my-app-config-file}` fragment with optional `groupQuerySize` field
118
+
[source,yaml]
119
+
----
120
+
catalog:
121
+
providers:
122
+
keycloakOrg:
123
+
default:
124
+
groupQuerySize: 100
125
+
----
126
+
127
+
`schedule.frequency`::
128
+
To specify custom schedule frequency.
129
+
Supports cron, ISO duration, and "human duration" as used in code.
130
+
+
131
+
.`{my-app-config-file}` fragment with optional `schedule.frequency` field
132
+
[source,yaml]
133
+
----
134
+
catalog:
135
+
providers:
136
+
keycloakOrg:
137
+
default:
138
+
schedule:
139
+
frequency: { hours: 1 }
140
+
----
141
+
142
+
`schedule.timeout`::
143
+
To specify custom timeout.
144
+
Supports ISO duration and "human duration" as used in code.
145
+
+
146
+
.`{my-app-config-file}` fragment with optional `schedule.timeout` field
147
+
[source,yaml]
148
+
----
149
+
catalog:
150
+
providers:
151
+
keycloakOrg:
152
+
default:
153
+
schedule:
154
+
timeout: { minutes: 50 }
155
+
----
156
+
157
+
`schedule.initialDelay`::
158
+
To specify custom initial delay.
159
+
Supports ISO duration and "human duration" as used in code.
160
+
+
161
+
.`{my-app-config-file}` fragment with optional `schedule.initialDelay` field
162
+
[source,yaml]
163
+
----
164
+
catalog:
165
+
providers:
166
+
keycloakOrg:
167
+
default:
168
+
schedule:
169
+
initialDelay: { seconds: 15}
170
+
----
171
+
--
172
+
34
173
. To set up the {rhbk} authentication provider in your {product-short} custom configuration, edit your custom {product-short} ConfigMap such as `app-config-rhdh`, and add the following lines to the `{my-app-config-file}` content:
35
174
36
175
.. Configure mandatory fields:
@@ -212,6 +351,17 @@ If multiple valid refresh tokens are issued due to frequent refresh token reques
212
351
====
213
352
214
353
.Verification
215
-
. Go to the {product-short} login page.
216
-
. Your {product-short} sign-in page displays *Sign in using OIDC* and the Guest user sign-in is disabled.
217
-
. Log in with OIDC by using the saved **Username** and **Password** values.
354
+
355
+
. To verify user and group provisioning, check the console logs.
356
+
+
357
+
.Successful synchronization example:
358
+
[source,json]
359
+
----
360
+
{"class":"KeycloakOrgEntityProvider","level":"info","message":"Read 3 Keycloak users and 2 Keycloak groups in 1.5 seconds. Committing...","plugin":"catalog","service":"backstage","taskId":"KeycloakOrgEntityProvider:default:refresh","taskInstanceId":"bf0467ff-8ac4-4702-911c-380270e44dea","timestamp":"2024-09-25 13:58:04"}
361
+
{"class":"KeycloakOrgEntityProvider","level":"info","message":"Committed 3 Keycloak users and 2 Keycloak groups in 0.0 seconds.","plugin":"catalog","service":"backstage","taskId":"KeycloakOrgEntityProvider:default:refresh","taskInstanceId":"bf0467ff-8ac4-4702-911c-380270e44dea","timestamp":"2024-09-25 13:58:04"}
362
+
----
363
+
364
+
. To verify {rhbk} user authentication:
365
+
.. Go to the {product-short} login page.
366
+
.. Your {product-short} sign-in page displays *Sign in using OIDC* and the Guest user sign-in is disabled.
367
+
.. Log in with OIDC by using the saved **Username** and **Password** values.
0 commit comments