Skip to content

Commit d684ca2

Browse files
committed
better examples
1 parent 6ba6b94 commit d684ca2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/admin/external-auth.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ CODER_EXTERNAL_AUTH_0_DISPLAY_ICON="https://mycustomicon.com/google.svg"
3636
```
3737

3838
The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used as an identifier for the authentication provider.
39+
3940
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`.
4042
Set it with a value that helps you identify the provider.
4143
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`.
4345

4446
### Add an authentication button to the workspace template
4547

@@ -188,16 +190,16 @@ For a more complete, step-by-step guide, follow the
188190
[configure a GitHub OAuth app](#configure-a-github-oauth-app) section instead.
189191

190192
```env
191-
CODER_EXTERNAL_AUTH_0_ID="USER_DEFINED_ID"
193+
CODER_EXTERNAL_AUTH_0_ID="primary-github"
192194
CODER_EXTERNAL_AUTH_0_TYPE=github
193195
CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx
194196
CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx
195197
```
196198

197199
When configuring your GitHub OAuth application, set the
198200
[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.
201203

202204
### GitHub Enterprise
203205

@@ -216,7 +218,7 @@ CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://github.example.com/login/oauth/access_t
216218
When configuring your GitHub Enterprise OAuth application, set the
217219
[authorization callback URL](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url)
218220
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.
220222

221223
### GitLab self-managed
222224

@@ -272,7 +274,7 @@ CODER_EXTERNAL_AUTH_0_SCOPES="repo:read repo:write write:gpg_key"
272274
1. [Create a GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app)
273275

274276
- 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`
276278
is the value you set for `CODER_EXTERNAL_AUTH_0_ID`.
277279
- Deactivate Webhooks.
278280
- Enable fine-grained access to specific repositories or a subset of

0 commit comments

Comments
 (0)