Skip to content

Commit c824980

Browse files
themr0cJessicaJHee
andcommitted
RHIDP-7975 Enabling authentication procedures with mandatory steps only
Used variable names defined in the default config Added '_mod-docs-content-type' attribute definition Signed-off-by: Fabrice Flore-Thébault <[email protected]> Co-authored-by: Jessica He <[email protected]>
1 parent 1c8b1da commit c824980

File tree

6 files changed

+111
-65
lines changed

6 files changed

+111
-65
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
:only-default-steps:
3+
4+
[id='enabling-authentication-with-mandatory-steps-only']
5+
= Enabling authentication in {product} (with mandatory steps only)
6+
7+
include::modules/authentication/con-understanding-authentication-and-user-provisioning.adoc[leveloffset=+1]
8+
9+
10+
include::assembly-authenticating-with-the-guest-user.adoc[leveloffset=+1]
11+
12+
13+
include::modules/authentication/proc-enabling-user-authentication-with-rhbk.adoc[leveloffset=+1]
14+
15+
16+
include::modules/authentication/proc-enabling-user-authentication-with-github.adoc[leveloffset=+1]
17+
18+
19+
include::modules/authentication/proc-enabling-user-authentication-with-microsoft-azure.adoc[leveloffset=+1]
20+

modules/authentication/con-understanding-authentication-and-user-provisioning.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ To explore {product-short} features in a non-production environment, you can:
2929
3030
* To use {product-short} without external IdP, enable the guest user to skip configuring authentication and authorization, log in as the guest user, and access all {product-short} features.
3131
32-
* To use {product-short} without authorization policies and features relying on the software catalog, you can enable the `dangerouslyAllowSignInWithoutUserInCatalog` resolver option. This setting bypasses the check requiring a user to be in the catalog but still enforces authentication.
32+
* To use {product-short} without authorization policies and features relying on the software catalog, you can enable the `dangerouslyAllowSignInWithoutUserInCatalog` resolver option.
33+
This setting bypasses the check requiring a user to be in the catalog but still enforces authentication.
3334
====
3435

3536
[IMPORTANT]
3637
====
37-
{product-short} uses a one-way synchronization model, where user and group data flow from your Identity Provider to the {product-short} software catalog. As a result, deleting users or groups manually through the {product-short} Web UI or REST API might be ineffective or cause inconsistencies, since those entities will be recreated during the next ingestion.
38+
{product-short} uses a one-way synchronization model, where user and group data flow from your Identity Provider to the {product-short} software catalog.
39+
As a result, deleting users or groups manually through the {product-short} Web UI or REST API might be ineffective or cause inconsistencies, since those entities will be recreated during the next ingestion.
3840
====

modules/authentication/proc-enabling-user-authentication-with-github.adoc

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
To authenticate users with GitHub, configure the GitHub authentication provider in {product} and provision the users and groups from GitHub to the {product-short} software catalog.
77

88
.Prerequisites
9-
* You {configuring-book-link}[added a custom {product-short} application configuration], and have sufficient permissions to modify it.
9+
* You {configuring-book-link}[added a custom {product-short} application configuration], and have enough permissions to change it.
1010

11-
* You have sufficient permissions in GitHub to create and manage a link:https://docs.github.com/en/apps/overview[GitHub App].
11+
* You have enough permissions in GitHub to create and manage a link:https://docs.github.com/en/apps/overview[GitHub App].
1212
Alternatively, you can ask your GitHub administrator to prepare the required GitHub App.
1313

1414
.Procedure
@@ -47,22 +47,23 @@ Select `Only on this account`.
4747
. To add your GitHub credentials to {product-short}, add the following key/value pairs to {configuring-book-link}#provisioning-your-custom-configuration[your {product-short} secrets].
4848
You can use these secrets in the {product-short} configuration files by using their respective environment variable name.
4949

50-
`AUTHENTICATION_GITHUB_CLIENT_ID`::
50+
`GITHUB_CLIENT_ID`::
5151
Enter the saved **Client ID**.
5252

53-
`AUTHENTICATION_GITHUB_CLIENT_SECRET`::
53+
`GITHUB_CLIENT_SECRET`::
5454
Enter the saved **Client Secret**.
5555

56-
`AUTHENTICATION_GITHUB_HOST_DOMAIN`::
56+
`GITHUB_URL`::
5757
Enter the GitHub host domain: `github.com`.
5858

59-
`AUTHENTICATION_GITHUB_ORGANIZATION`::
59+
`GITHUB_ORG`::
6060
Enter your GitHub organization name, such as `__<your_github_organization_name>__`.
6161

6262
. Enable the GitHub organization provisioning plugin (`backstage-plugin-catalog-backend-module-github-org`).
6363
This plugin ingests GitHub users and groups to the {product-short} software catalog.
6464
+
65-
.`dynamic-plugins.yaml` file fragment
65+
`dynamic-plugins.yaml` file fragment:
66+
+
6667
[source,yaml]
6768
----
6869
plugins:
@@ -81,8 +82,8 @@ catalog:
8182
providers:
8283
githubOrg:
8384
id: githuborg
84-
githubUrl: "${AUTHENTICATION_GITHUB_HOST_DOMAIN}"
85-
orgs: [ "${AUTHENTICATION_GITHUB_ORGANIZATION}" ]
85+
githubUrl: "${GITHUB_URL}"
86+
orgs: [ "${GITHUB_ORG}" ]
8687
schedule:
8788
frequency:
8889
minutes: 30
@@ -97,10 +98,10 @@ Enter a stable identifier for this provider, such as `githuborg`.
9798
Entities from this provider are associated with this identifier, therefore you must take care not to change it over time since that might lead to orphaned entities and/or conflicts.
9899

99100
`githubUrl`::
100-
Enter the configured secret variable name: `${AUTHENTICATION_GITHUB_HOST_DOMAIN}`.
101+
Enter the configured secret variable name: `$\{GITHUB_URL}`.
101102

102103
`orgs`::
103-
Enter the configured secret variable name: `${AUTHENTICATION_GITHUB_ORGANIZATION}`.
104+
Enter the configured secret variable name: `$\{GITHUB_ORG}`.
104105

105106
`schedule.frequency`::
106107
Enter your schedule frequency, in the cron, ISO duration, or "human duration" format.
@@ -123,23 +124,24 @@ auth:
123124
providers:
124125
github:
125126
production:
126-
clientId: ${AUTHENTICATION_GITHUB_CLIENT_ID}
127-
clientSecret: ${AUTHENTICATION_GITHUB_CLIENT_SECRET}
127+
clientId: ${GITHUB_CLIENT_ID}
128+
clientSecret: ${GITHUB_CLIENT_SECRET}
128129
signInPage: github
129130
----
130131

131132
`environment`::
132133
Enter `production` to disable the Guest login option in the {product-short} login page.
133134

134135
`clientId`::
135-
Enter the configured secret variable name: `${AUTHENTICATION_GITHUB_CLIENT_ID}`.
136+
Enter the configured secret variable name: `$\{GITHUB_CLIENT_ID}`.
136137

137138
`clientSecret`::
138-
Enter the configured secret variable name: `${AUTHENTICATION_GITHUB_CLIENT_SECRET}`.
139+
Enter the configured secret variable name: `$\{GITHUB_CLIENT_SECRET}`.
139140

140141
`signInPage`::
141142
Enter `github` to enable the GitHub provider as your {product-short} sign-in provider.
142143

144+
ifndef::only-default-steps[]
143145
Optional: Consider adding the following optional fields:
144146

145147
.`{my-app-config-file}` file fragment including optional fields to enable authentication with GitHub
@@ -150,8 +152,8 @@ auth:
150152
providers:
151153
github:
152154
production:
153-
clientId: ${AUTHENTICATION_GITHUB_CLIENT_ID}
154-
clientSecret: ${AUTHENTICATION_GITHUB_CLIENT_SECRET}
155+
clientId: ${GITHUB_CLIENT_ID}
156+
clientSecret: ${GITHUB_CLIENT_SECRET}
155157
callbackUrl: __<your_intermediate_service_url/handler>__
156158
sessionDuration: { hours: 24 }
157159
signIn:
@@ -178,7 +180,10 @@ Enter the resolver list to override the default resolver: `usernameMatchingUserE
178180
+
179181
The authentication provider tries each sign-in resolver in order until it succeeds, and fails if none succeed.
180182
+
181-
WARNING: In production mode, only configure one resolver to ensure users are securely matched.
183+
[WARNING]
184+
====
185+
In production mode, only configure one resolver to ensure users are securely matched.
186+
====
182187

183188
`resolver`::::
184189
Enter the sign-in resolver name.
@@ -191,13 +196,18 @@ Available resolvers:
191196
`dangerouslyAllowSignInWithoutUserInCatalog: true`::::
192197
Configure the sign-in resolver to bypass the user provisioning requirement in the {product-short} software catalog.
193198
+
194-
WARNING: Use `dangerouslyAllowSignInWithoutUserInCatalog` to explore {product-short} features, but do not use it in production.
199+
[WARNING]
200+
====
201+
Use `dangerouslyAllowSignInWithoutUserInCatalog` to explore {product-short} features, but do not use it in production.
202+
====
203+
endif::[]
195204
--
196205

197206
.Verification
198207
. To verify user and group provisioning, check the console logs.
199208
+
200-
.Successful synchronization example:
209+
Successful synchronization example:
210+
+
201211
[source,json]
202212
----
203213
{"class":"GithubMultiOrgEntityProvider","level":"info","message":"Reading GitHub users and teams for org: rhdh-dast","plugin":"catalog","service":"backstage","target":"https://github.com","taskId":"GithubMultiOrgEntityProvider:githuborg:refresh","taskInstanceId":"801b3c6c-167f-473b-b43e-e0b4b780c384","timestamp":"2024-09-09 23:55:58"}
@@ -210,6 +220,5 @@ WARNING: Use `dangerouslyAllowSignInWithoutUserInCatalog` to explore {product-sh
210220
.. Log in with a GitHub account.
211221

212222
.Additional resources
213-
214223
* {integrating-with-github-book-link}[{integrating-with-github-book-title}]
215224

modules/authentication/proc-enabling-user-authentication-with-microsoft-azure.adoc

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To authenticate users with {azure-brand-name}, configure the {azure-short} authe
99
* You have the permission to register an application in {azure-short}.
1010
Alternatively, you can ask your {azure-short} administrator to prepare the required {azure-short} application.
1111

12-
* You {configuring-book-link}[added a custom {product-short} application configuration], and have sufficient permissions to modify it.
12+
* You {configuring-book-link}[added a custom {product-short} application configuration], and have enough permissions to modify it.
1313

1414
* Your {product-short} backend can access the following hosts:
1515

@@ -82,10 +82,10 @@ Enter your saved *Application (client) ID*.
8282
`AUTHENTICATION_AZURE_CLIENT_SECRET`::
8383
Enter your saved *Application (client) secret*.
8484

85-
. Enable the Microsoft Graph organization provisioning plugin (`backstage-plugin-catalog-backend-module-msgraph-dynamic`).
85+
. Enable the Microsoft Graph organization provisioning plugin (`backstage-plugin-catalog-backend-module-msgraph-dynamic`) in your `dynamic-plugins.yaml`
86+
file.
8687
This plugin ingests {azure-short} users and groups to the {product-short} software catalog.
8788
+
88-
.`dynamic-plugins.yaml` file fragment
8989
[source,yaml]
9090
----
9191
plugins:
@@ -124,13 +124,13 @@ Enter `\https://graph.microsoft.com/v1.0` to define the MSGraph API endpoint the
124124
You might change this parameter to use a different version, such as the link:https://learn.microsoft.com/en-us/graph/api/overview?view=graph-rest-beta#call-the-beta-endpoint[beta endpoint].
125125

126126
`tenandId`::
127-
Enter the configured secret variable name: `${AUTHENTICATION_AZURE_TENANT_ID}`.
127+
Enter the configured secret variable name: `$\{AUTHENTICATION_AZURE_TENANT_ID}`.
128128

129129
`clientId`::
130-
Enter the configured secret variable name: `${AUTHENTICATION_AZURE_CLIENT_ID}`.
130+
Enter the configured secret variable name: `$\{AUTHENTICATION_AZURE_CLIENT_ID}`.
131131

132132
`clientSecret`::
133-
Enter the configured secret variable name: `${AUTHENTICATION_AZURE_CLIENT_SECRET}`.
133+
Enter the configured secret variable name: `$\{AUTHENTICATION_AZURE_CLIENT_SECRET}`.
134134

135135
`schedule`::
136136

@@ -145,12 +145,12 @@ In a large organization, user provisioning might take a long time, therefore avo
145145
`initialDelay`:::
146146
Enter the schedule initial delay in the ISO duration or human duration format.
147147

148+
ifndef::only-default-steps[]
148149
Optional: Consider adding the following optional `microsoftGraphOrg.providerId` fields:
149150

150151
[id=authority]
151152
`authority`::
152-
Enter your link:https://learn.microsoft.com/en-us/graph/deployments#app-registration-and-token-service-root-endpoints[{azure-short} authority URL],
153-
when different from the default: `\https://login.microsoftonline.com`.
153+
Enter your link:https://learn.microsoft.com/en-us/graph/deployments#app-registration-and-token-service-root-endpoints[{azure-short} authority URL], when different from the default: `\https://login.microsoftonline.com`.
154154
+
155155
.`{my-app-config-file}` fragment with optional `queryMode` field
156156
[source,yaml]
@@ -164,7 +164,7 @@ catalog:
164164

165165
[id=queryMode]
166166
`queryMode: basic | advanced`::
167-
Enter `advanced` when the default `basic` query mode is not sufficient for your queries to the Microsoft Graph API.
167+
Enter `advanced` when the default `basic` query mode is insufficient for your queries to the Microsoft Graph API.
168168
See link:https://learn.microsoft.com/en-us/graph/aad-advanced-queries[{azure-brand-name} advanced queries].
169169
+
170170
.`{my-app-config-file}` fragment with optional `queryMode` field
@@ -184,7 +184,8 @@ Only one relationship can be expanded in a single request.
184184
See https://learn.microsoft.com/en-us/graph/query-parameters#expand-parameter[Microsoft Graph query expand parameter].
185185
This parameter can be combined with xref:userGroupMemberFilter[`userGroupMember.filter`] or xref:userFilter[`user.filter`].
186186
+
187-
.`{my-app-config-file}` fragment with optional `user.expand` field
187+
`{my-app-config-file}` fragment with optional `user.expand` field:
188+
+
188189
[source,yaml]
189190
----
190191
catalog:
@@ -201,7 +202,8 @@ To filter users.
201202
See link:https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#properties[Microsoft Graph API] and link:https://learn.microsoft.com/en-us/graph/query-parameters#filter-parameter[Microsoft Graph API query filter parameters syntax].
202203
This parameter and xref:userGroupMemberFilter[`userGroupMember.filter`] are mutually exclusive, only one can be specified.
203204
+
204-
.`{my-app-config-file}` fragment with optional `user.filter` field
205+
`{my-app-config-file}` fragment with optional `user.filter` field:
206+
+
205207
[source,yaml]
206208
----
207209
catalog:
@@ -217,7 +219,8 @@ catalog:
217219
{product-short} loads photos by default.
218220
Enter `false` to avoid loading user photos.
219221
+
220-
.`{my-app-config-file}` fragment with optional `user.loadPhotos` field
222+
`{my-app-config-file}` fragment with optional `user.loadPhotos` field:
223+
+
221224
[source,yaml]
222225
----
223226
catalog:
@@ -232,7 +235,8 @@ catalog:
232235
`user.select`::
233236
Enter the link:https://learn.microsoft.com/en-us/graph/api/resources/schemaextension?view=graph-rest-1.0[Microsoft Graph resource type] list to retrieve.
234237
+
235-
.`{my-app-config-file}` fragment with optional `user.select` field
238+
`{my-app-config-file}` fragment with optional `user.select` field:
239+
+
236240
[source,yaml]
237241
----
238242
catalog:
@@ -249,7 +253,8 @@ To use group membership to get users.
249253
To filter groups and fetch their members.
250254
This parameter and xref:userFilter[`user.filter`] are mutually exclusive, only one can be specified.
251255
+
252-
.`{my-app-config-file}` fragment with optional `userGroupMember.filter` field
256+
`{my-app-config-file}` fragment with optional `userGroupMember.filter` field:
257+
+
253258
[source,yaml]
254259
----
255260
catalog:
@@ -266,7 +271,8 @@ To use group membership to get users.
266271
To search for groups and fetch their members.
267272
This parameter and xref:userFilter[`user.filter`] are mutually exclusive, only one can be specified.
268273
+
269-
.`{my-app-config-file}` fragment with optional `userGroupMember.search` field
274+
`{my-app-config-file}` fragment with optional `userGroupMember.search` field:
275+
+
270276
[source,yaml]
271277
----
272278
catalog:
@@ -284,7 +290,8 @@ Only one relationship can be expanded in a single request.
284290
See link:https://learn.microsoft.com/en-us/graph/query-parameters#expand-parameter[Customize Microsoft Graph responses with query parameters].
285291
This parameter can be combined with xref:userGroupMemberFilter[`userGroupMember.filter`] instead of xref:userFilter[`user.filter`].
286292
+
287-
.`{my-app-config-file}` fragment with optional `group.expand` field
293+
`{my-app-config-file}` fragment with optional `group.expand` field:
294+
+
288295
[source,yaml]
289296
----
290297
catalog:
@@ -300,7 +307,8 @@ catalog:
300307
To filter groups.
301308
See link:https://learn.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0#properties[Microsoft Graph API query group syntax].
302309
+
303-
.`{my-app-config-file}` fragment with optional `group.filter` field
310+
`{my-app-config-file}` fragment with optional `group.filter` field:
311+
+
304312
[source,yaml]
305313
----
306314
catalog:
@@ -316,7 +324,8 @@ catalog:
316324
To search for groups.
317325
See link:https://learn.microsoft.com/en-us/graph/search-query-parameter[Microsoft Graph API query search parameter].
318326
+
319-
.`{my-app-config-file}` fragment with optional `group.search` field
327+
`{my-app-config-file}` fragment with optional `group.search` field:
328+
+
320329
[source,yaml]
321330
----
322331
catalog:
@@ -342,6 +351,7 @@ catalog:
342351
select: ['id', 'displayName', 'description']
343352
----
344353
--
354+
endif::[]
345355

346356
. To set up the {azure-short} authentication provider, add the `auth.providers.microsoft` section to your `{my-app-config-file}` file content:
347357
+
@@ -364,14 +374,14 @@ signInPage: microsoft
364374
Enter `production` to disable the **Guest** login option in the {product-short} login page.
365375

366376
`clientId`::
367-
Enter the configured secret variable name: `${AUTHENTICATION_AZURE_CLIENT_ID}`.
377+
Enter the configured secret variable name: `$\{AUTHENTICATION_AZURE_CLIENT_ID}`.
368378

369379
`clientSecret`::
370380
Enter the configured secret variable name:
371-
`${AUTHENTICATION_AZURE_CLIENT_SECRET}`.
381+
`$\{AUTHENTICATION_AZURE_CLIENT_SECRET}`.
372382

373383
`tenantId`::
374-
Enter the configured secret variable name: `${AUTHENTICATION_AZURE_TENANT_ID}`.
384+
Enter the configured secret variable name: `$\{AUTHENTICATION_AZURE_TENANT_ID}`.
375385

376386
`signInPage`::
377387
Enter `microsoft` to set the {azure-short} provider as your {product-short} sign-in provider.
@@ -399,9 +409,10 @@ auth:
399409
`additionalScopes`::
400410
Optional for additional scopes.
401411
To add scopes for the application registration, uncomment and enter the list of scopes that you want to add.
402-
The default and mandatory value lists: `'openid', 'offline_access', 'profile', 'email', 'User.Read'`.
412+
The default and mandatory value lists: `openid`, `offline_access`, `profile`, `email`, and `User.Read`.
413+
+
414+
`{my-app-config-file}` file fragment with optional `additionalScopes` field:
403415
+
404-
.`{my-app-config-file}` file fragment with optional `additionalScopes` field
405416
[source,yaml,subs="+quotes,+attributes"]
406417
----
407418
auth:

0 commit comments

Comments
 (0)