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
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 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`.
38
+
The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used as an identifier for the authentication provider.
39
+
This variable is used as part of the callback URL path that you must configure in your OAuth provider settings.
40
+
Set it with a value that helps you identify the provider.
41
+
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`.
43
+
44
+
### Add an authentication button to the workspace template
37
45
38
46
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:
39
47
@@ -50,7 +58,8 @@ data "coder_external_auth" "github" {
50
58
51
59
```
52
60
53
-
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.
61
+
Inside your Terraform code, you now have access to authentication variables.
62
+
Reference the documentation for your chosen provider for more information on how to supply it with a token.
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`.
115
+
When configuring your Bitbucket OAuth application, set the redirect URI to
> 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").
188
+
When [configuring your GitLab OAuth application](https://docs.gitlab.com/17.5/integration/oauth_provider/),
189
+
set the redirect URI to `https://example.com/external-auth/primary-gitlab/callback`.
190
+
Note that the redirect URI must include the value of `CODER_EXTERNAL_AUTH_0_ID` (in this example, `primary-gitlab`).
0 commit comments