You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: clarify that CODER_EXTERNAL_AUTH_0_ID is used in callback URLs (#16879)
## Summary
- Clarifies that the CODER_EXTERNAL_AUTH_0_ID value is used as part of
the OAuth callback URL path
- Adds explicit callback URL examples to GitLab and Bitbucket Server
sections
- Updates the GitHub OAuth app configuration instructions to be more
explicit
- Fixes the documentation mistake where it claimed this ID was only for
"internal reference"
## Test plan
- Documentation change only
- Verified consistency across all OAuth provider sections
Fixes#16851
[preview](https://coder.com/docs/@fix-external-auth-docs-16851/admin/external-auth)
<sub>🤖 Generated with [Claude Code](https://claude.ai/code)</sub>
---------
Co-authored-by: EdwardAngert <[email protected]>
Co-authored-by: Edward Angert <[email protected]>
Co-authored-by: M Atif Ali <[email protected]>
If you have experience with a provider that is not listed here, please
19
19
[file an issue](https://github.com/coder/internal/issues/new?title=request%28docs%29%3A+external-auth+-+request+title+here%0D%0A&labels=["customer-feedback","docs"]&body=doc%3A+%5Bexternal-auth%5D%28https%3A%2F%2Fcoder.com%2Fdocs%2Fadmin%2Fexternal-auth%29%0D%0A%0D%0Aplease+enter+your+request+here%0D%0A)
20
20
21
21
## Configuration
22
22
23
+
### Set environment variables
24
+
23
25
After you create an OAuth application, set environment variables to configure the Coder server to use it:
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.
38
+
The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used as an identifier for the authentication provider.
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`.
42
+
Set it with a value that helps you identify the provider.
43
+
For example, if you use `CODER_EXTERNAL_AUTH_0_ID="primary-github"` for your GitHub provider,
44
+
configure your callback URL as `https://example.com/external-auth/primary-github/callback`.
45
+
46
+
### Add an authentication button to the workspace template
39
47
40
48
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:
41
49
@@ -52,7 +60,8 @@ data "coder_external_auth" "github" {
52
60
53
61
```
54
62
55
-
Inside your Terraform code, you now have access to authentication variables. Reference the documentation for your chosen provider for more information on how to supply it with a token.
63
+
Inside your Terraform code, you now have access to authentication variables.
64
+
Reference the documentation for your chosen provider for more information on how to supply it with a token.
0 commit comments