@@ -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
@@ -66,7 +68,7 @@ Reference the documentation for your chosen provider for more information on how
66
68
Use [ ` external-auth ` ] ( ../reference/cli/external-auth.md ) in the Coder CLI to access a token within the workspace:
67
69
68
70
``` shell
69
- coder external-auth < USER_DEFINED_ID > access-token
71
+ coder external-auth access-token < USER_DEFINED_ID >
70
72
```
71
73
72
74
## Git-provider specific env variables
@@ -139,16 +141,16 @@ For a more complete, step-by-step guide, follow the
139
141
[ configure a GitHub OAuth app] ( #configure-a-github-oauth-app ) section instead.
140
142
141
143
``` env
142
- CODER_EXTERNAL_AUTH_0_ID="USER_DEFINED_ID "
144
+ CODER_EXTERNAL_AUTH_0_ID="primary-github "
143
145
CODER_EXTERNAL_AUTH_0_TYPE=github
144
146
CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx
145
147
CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx
146
148
```
147
149
148
150
When configuring your GitHub OAuth application, set the
149
151
[ authorization callback URL] ( https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url )
150
- as ` https://example.com/external-auth/USER_DEFINED_ID /callback ` , where
151
- ` USER_DEFINED_ID ` matches your ` CODER_EXTERNAL_AUTH_0_ID ` value (in this example, ` USER_DEFINED_ID ` ) .
152
+ as ` https://example.com/external-auth/primary-github /callback ` , where
153
+ ` primary-github ` matches your ` CODER_EXTERNAL_AUTH_0_ID ` value.
152
154
153
155
### GitHub Enterprise
154
156
@@ -167,7 +169,7 @@ CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://github.example.com/login/oauth/access_t
167
169
When configuring your GitHub Enterprise OAuth application, set the
168
170
[ authorization callback URL] ( https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url )
169
171
as ` https://example.com/external-auth/primary-github/callback ` , where
170
- ` USER_DEFINED_ID ` matches your ` CODER_EXTERNAL_AUTH_0_ID ` value (in this example, ` primary-github ` ) .
172
+ ` primary-github ` matches your ` CODER_EXTERNAL_AUTH_0_ID ` value.
171
173
172
174
### GitLab self-managed
173
175
@@ -223,7 +225,7 @@ CODER_EXTERNAL_AUTH_0_SCOPES="repo:read repo:write write:gpg_key"
223
225
1 . [ Create a GitHub App] ( https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app )
224
226
225
227
- Set the authorization callback URL to
226
- ` https://coder.example.com/external-auth/USER_DEFINED_ID /callback ` , where ` USER_DEFINED_ID `
228
+ ` https://coder.example.com/external-auth/primary-github /callback ` , where ` primary-github `
227
229
is the value you set for ` CODER_EXTERNAL_AUTH_0_ID ` .
228
230
- Deactivate Webhooks.
229
231
- Enable fine-grained access to specific repositories or a subset of
0 commit comments