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: update external auth to better explain process (#15970)
Reference #15968
Adds more information on how to add external auth, including
docker-compose and docker CLI examples and terraform code for template
integration.
---------
Co-authored-by: Muhammad Atif Ali <me@matifali.dev>
The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used for internal
27
28
reference. Therefore, it can be set arbitrarily (e.g., `primary-github` for your
28
29
GitHub provider).
29
30
31
+
You can now add the following code to any template. This will add a button to the workspace setup page which will allow you to authenticate with your provider.
32
+
33
+
```tf
34
+
data "coder_external_auth" "<github|gitlab|azure-devops|bitbucket-cloud|bitbucket-server|etc>" {
35
+
id = "<USER_DEFINED_ID>"
36
+
}
37
+
38
+
# Github Example (CODER_EXTERNAL_AUTH_0_ID="github-auth")
39
+
# makes a github authentication token available at data.coder_external_auth.github.access_token
40
+
data "coder_external_auth" "github" {
41
+
id = "github-auth"
42
+
}
43
+
44
+
```
45
+
46
+
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.
47
+
48
+
### Workspace CLI
49
+
An access token can be accessed within the workspace by using
0 commit comments