Skip to content

Commit fff9d84

Browse files
bpmctclaude
andcommitted
docs: clarify that CODER_EXTERNAL_AUTH_0_ID is used in callback URLs
This commit clarifies that the CODER_EXTERNAL_AUTH_0_ID value is used as part of the callback URL path when configuring external authentication providers. The documentation previously stated it was only for internal reference, which was misleading as it's a critical part of the OAuth provider configuration. Fixes #16851 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 09dd69a commit fff9d84

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/admin/external-auth.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ CODER_EXTERNAL_AUTH_0_DISPLAY_NAME="Google Calendar"
3333
CODER_EXTERNAL_AUTH_0_DISPLAY_ICON="https://mycustomicon.com/google.svg"
3434
```
3535

36-
The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used for internal
37-
reference. Set it with a value that helps you identify it. For example, you can use `CODER_EXTERNAL_AUTH_0_ID="primary-github"` for your
38-
GitHub provider.
36+
The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used as an identifier for the authentication provider. **This ID is also used as part of the callback URL path** that you must configure in your OAuth provider settings. Set it with a value that helps you identify the provider. For example, you can use `CODER_EXTERNAL_AUTH_0_ID="primary-github"` for your GitHub provider. Your callback URL would then be `https://your-coder-domain.com/external-auth/primary-github/callback`.
3937

4038
Add the following code to any template to add a button to the workspace setup page which will allow you to authenticate with your provider:
4139

@@ -105,6 +103,8 @@ CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxx
105103
CODER_EXTERNAL_AUTH_0_AUTH_URL=https://bitbucket.domain.com/rest/oauth2/latest/authorize
106104
```
107105

106+
When configuring your Bitbucket OAuth application, set the Redirect URI to `https://your-coder-domain.com/external-auth/primary-bitbucket-server/callback`. The callback path includes the value of `CODER_EXTERNAL_AUTH_0_ID`.
107+
108108
### Gitea
109109

110110
```env
@@ -161,6 +161,9 @@ CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://gitlab.company.org/oauth/token"
161161
CODER_EXTERNAL_AUTH_0_REGEX=gitlab\.company\.org
162162
```
163163

164+
> [!IMPORTANT]
165+
> When configuring your GitLab OAuth application, set the Redirect URI to `https://your-coder-domain.com/external-auth/primary-gitlab/callback`. Note that the callback URL must include the value of `CODER_EXTERNAL_AUTH_0_ID` (in this example, "primary-gitlab").
166+
164167
### JFrog Artifactory
165168

166169
Visit the [JFrog Artifactory](../admin/integrations/jfrog-artifactory.md) guide for instructions on how to set up for JFrog Artifactory.
@@ -195,7 +198,8 @@ CODER_EXTERNAL_AUTH_0_SCOPES="repo:read repo:write write:gpg_key"
195198
1. [Create a GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app)
196199

197200
- Set the callback URL to
198-
`https://coder.example.com/external-auth/USER_DEFINED_ID/callback`.
201+
`https://coder.example.com/external-auth/USER_DEFINED_ID/callback`, where `USER_DEFINED_ID`
202+
is the value you set for `CODER_EXTERNAL_AUTH_0_ID`.
199203
- Deactivate Webhooks.
200204
- Enable fine-grained access to specific repositories or a subset of
201205
permissions for security.

0 commit comments

Comments
 (0)