Skip to content

Commit c02215c

Browse files
committed
minimalism and clarity
Signed-off-by: Fabrice Flore-Thébault <[email protected]>
1 parent 540248a commit c02215c

File tree

1 file changed

+45
-16
lines changed

1 file changed

+45
-16
lines changed

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

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ Select `Only on this account`.
3737
* **Client ID**
3838
* **Client secret**
3939

40-
. To add your GitHub credentials to {product-short}, add the following key/value pairs to link:{configuring-dynamic-plugins-book-url}#provisioning-your-custom-configuration[your {product-short} secrets]:
40+
. To add your GitHub credentials to {product-short}, add the following key/value pairs to link:{configuring-dynamic-plugins-book-url}#provisioning-your-custom-configuration[your {product-short} secrets].
41+
You can use these secrets in the {product-short} configuration files by using their respective environment variable name.
4142
+
4243
`AUTHENTICATION_GITHUB_CLIENT_ID`::
4344
Enter the saved **Client ID**.
@@ -49,7 +50,7 @@ Enter the saved **Client Secret**.
4950
Enter the GitHub host domain: `github.com`.
5051

5152
`AUTHENTICATION_GITHUB_ORGANIZATION`::
52-
Enter your GitHub organization name, such as `__<your_github_organization_name>__'.
53+
Enter your GitHub organization name, such as `__<your_github_organization_name>__`.
5354

5455
. Enable the `backstage-plugin-catalog-backend-module-github-org` plugin.
5556
+
@@ -82,8 +83,11 @@ catalog:
8283
minutes: 15
8384
----
8485

85-
`githubUrl` and `orgs`::
86-
Use the configured secrets.
86+
`githubUrl`::
87+
Enter the configured secret variable name: `${AUTHENTICATION_GITHUB_HOST_DOMAIN}`.
88+
89+
`orgs`::
90+
Enter the configured secret variable name: `${AUTHENTICATION_GITHUB_ORGANIZATION}`.
8791

8892
`schedule.frequency`::
8993
Enter your schedule frequency, in the cron, ISO duration, or "human duration" format.
@@ -97,6 +101,7 @@ Enter your schedule initial delay, in the ISO duration or "human duration" forma
97101

98102
. To set up the GitHub authentication provider, add the `auth.providers.github` section to the `{my-app-config-file}` file content:
99103
+
104+
--
100105
.`{my-app-config-file}` file fragment with mandatory fields to enable authentication with GitHub
101106
[source,yaml]
102107
----
@@ -109,16 +114,40 @@ auth:
109114
clientSecret: ${AUTHENTICATION_GITHUB_CLIENT_SECRET}
110115
signInPage: github
111116
----
112-
+
113-
`environment: production`::
114-
Mark the environment as `production` and disable the Guest login option in the {product-short} login page.
115-
`clientId: ${AUTHENTICATION_GITHUB_CLIENT_ID}` and `clientSecret: ${AUTHENTICATION_GITHUB_CLIENT_SECRET}`::
116-
Apply the GitHub credentials configured in your {product-short} secrets.
117-
`signInPage: github`::
118-
To enable the GitHub provider as your {product-short} sign-in provider.
119-
+
117+
118+
`environment`::
119+
Enter `production` to disable the Guest login option in the {product-short} login page.
120+
121+
`clientId`::
122+
Enter the configured secret variable name: `${AUTHENTICATION_GITHUB_CLIENT_ID}`.
123+
124+
`clientSecret`::
125+
Enter the configured secret variable name: `${AUTHENTICATION_GITHUB_CLIENT_SECRET}`.
126+
127+
`signInPage`::
128+
Enter `github` to enable the GitHub provider as your {product-short} sign-in provider.
129+
120130
Optional: Consider adding the following optional fields:
121-
+
131+
132+
.`{my-app-config-file}` file fragment including optional fields to enable authentication with GitHub
133+
[source,yaml,subs="+quotes"]
134+
----
135+
auth:
136+
environment: production
137+
providers:
138+
github:
139+
production:
140+
clientId: ${AUTHENTICATION_GITHUB_CLIENT_ID}
141+
clientSecret: ${AUTHENTICATION_GITHUB_CLIENT_SECRET}
142+
callbackUrl: __<your_intermediate_service_url/handler>__
143+
sessionDuration: { hours: 24 }
144+
signIn:
145+
resolvers:
146+
- resolver: usernameMatchingUserEntityName
147+
dangerouslyAllowSignInWithoutUserInCatalog: true
148+
signInPage: github
149+
----
150+
122151
`callbackUrl`::
123152
Enter the callback URL that GitHub uses when initiating an OAuth flow, such as: __<your_intermediate_service_url/handler>__.
124153
Define it when {product-short} is not the immediate receiver, such as in cases when you use one OAuth app for many {product-short} instances.
@@ -134,8 +163,7 @@ auth:
134163
----
135164

136165
`sessionDuration`::
137-
Enter the user session lifespan.
138-
Enter a duration in `ms` library format (such as '24h', '2 days'), ISO duration, or "human duration" as used in code.
166+
Enter the user session lifespan, in `ms` library format (such as '24h', '2 days'), ISO duration, or "human duration".
139167
+
140168
.`app-config-rhdh.yaml` fragment with optional `sessionDuration` field
141169
[source,yaml,subs="+quotes"]
@@ -150,7 +178,7 @@ auth:
150178
`signIn`::
151179

152180
`resolvers`:::
153-
After successful authentication, the user signing in must be resolved to an existing user in the {product-short} catalog.
181+
After successful authentication, {product-short} resolves the user signing in to an existing user in the {product-short} catalog.
154182
To best match users securely for your use case, consider configuring a specific resolver.
155183
Enter the resolver list to override the default resolver: `usernameMatchingUserEntityName`.
156184
+
@@ -187,6 +215,7 @@ auth:
187215
dangerouslyAllowSignInWithoutUserInCatalog: true
188216
signInPage: github
189217
----
218+
--
190219

191220
.Verification
192221
. To verify user and group provisioning, check the console logs.

0 commit comments

Comments
 (0)