@@ -36,10 +36,12 @@ CODER_EXTERNAL_AUTH_0_DISPLAY_ICON="https://mycustomicon.com/google.svg"
36
36
```
37
37
38
38
The ` CODER_EXTERNAL_AUTH_0_ID ` environment variable is used as an identifier for the authentication provider.
39
+
39
40
This variable is used as part of the callback URL path that you must configure in your OAuth provider settings.
41
+ If the value in your callback URL doesn't match the ` CODER_EXTERNAL_AUTH_0_ID ` value, authentication will fail with ` redirect URI is not valid ` .
40
42
Set it with a value that helps you identify the provider.
41
43
For example, if you use ` CODER_EXTERNAL_AUTH_0_ID="primary-github" ` for your GitHub provider,
42
- your callback URL will be ` https://example.com/external-auth/primary-github/callback ` .
44
+ configure your callback URL as ` https://example.com/external-auth/primary-github/callback ` .
43
45
44
46
### Add an authentication button to the workspace template
45
47
@@ -188,16 +190,16 @@ For a more complete, step-by-step guide, follow the
188
190
[ configure a GitHub OAuth app] ( #configure-a-github-oauth-app ) section instead.
189
191
190
192
``` env
191
- CODER_EXTERNAL_AUTH_0_ID="USER_DEFINED_ID "
193
+ CODER_EXTERNAL_AUTH_0_ID="primary-github "
192
194
CODER_EXTERNAL_AUTH_0_TYPE=github
193
195
CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx
194
196
CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx
195
197
```
196
198
197
199
When configuring your GitHub OAuth application, set the
198
200
[ authorization callback URL] ( https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url )
199
- as ` https://example.com/external-auth/USER_DEFINED_ID /callback ` , where
200
- ` USER_DEFINED_ID ` matches your ` CODER_EXTERNAL_AUTH_0_ID ` value (in this example, ` USER_DEFINED_ID ` ) .
201
+ as ` https://example.com/external-auth/primary-github /callback ` , where
202
+ ` primary-github ` matches your ` CODER_EXTERNAL_AUTH_0_ID ` value.
201
203
202
204
### GitHub Enterprise
203
205
@@ -216,7 +218,7 @@ CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://github.example.com/login/oauth/access_t
216
218
When configuring your GitHub Enterprise OAuth application, set the
217
219
[ authorization callback URL] ( https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url )
218
220
as ` https://example.com/external-auth/primary-github/callback ` , where
219
- ` USER_DEFINED_ID ` matches your ` CODER_EXTERNAL_AUTH_0_ID ` value (in this example, ` primary-github ` ) .
221
+ ` primary-github ` matches your ` CODER_EXTERNAL_AUTH_0_ID ` value.
220
222
221
223
### GitLab self-managed
222
224
@@ -272,7 +274,7 @@ CODER_EXTERNAL_AUTH_0_SCOPES="repo:read repo:write write:gpg_key"
272
274
1 . [ Create a GitHub App] ( https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app )
273
275
274
276
- Set the authorization callback URL to
275
- ` https://coder.example.com/external-auth/USER_DEFINED_ID /callback ` , where ` USER_DEFINED_ID `
277
+ ` https://coder.example.com/external-auth/primary-github /callback ` , where ` primary-github `
276
278
is the value you set for ` CODER_EXTERNAL_AUTH_0_ID ` .
277
279
- Deactivate Webhooks.
278
280
- Enable fine-grained access to specific repositories or a subset of
0 commit comments