1
- # External Authentication
1
+ # Git Providers
2
2
3
- Coder integrates with Git and OpenID Connect to automate away the need for
4
- developers to authenticate with external services within their workspace.
3
+ Coder integrates with git providers to automate away the need for developers to
4
+ authenticate with repositories within their workspace.
5
5
6
- ## Git Providers
6
+ ## How it works
7
7
8
8
When developers use ` git ` inside their workspace, they are prompted to
9
9
authenticate. After that, Coder will store and refresh tokens for future
10
10
operations.
11
11
12
12
<video autoplay playsinline loop >
13
- <source src =" https://github.com/coder/coder/blob/main/site/static/external-auth .mp4?raw=true " type =" video/mp4 " >
13
+ <source src =" https://github.com/coder/coder/blob/main/site/static/gitauth .mp4?raw=true " type =" video/mp4 " >
14
14
Your browser does not support the video tag.
15
15
</video >
16
16
17
17
## Configuration
18
18
19
- To add an external authentication provider, you'll need to create an OAuth
20
- application. The following providers are supported:
19
+ To add a git provider, you'll need to create an OAuth application. The following
20
+ providers are supported:
21
21
22
- - [ GitHub] ( #github )
22
+ - [ GitHub] ( #github-app )
23
23
- [ GitLab] ( https://docs.gitlab.com/ee/integration/oauth_provider.html )
24
24
- [ BitBucket] ( https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/ )
25
25
- [ Azure DevOps] ( https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops )
26
26
27
27
Example callback URL:
28
- ` https://coder.example.com/external-auth /primary-github/callback ` . Use an
29
- arbitrary ID for your provider (e.g. ` primary-github ` ).
28
+ ` https://coder.example.com/gitauth /primary-github/callback ` . Use an arbitrary ID
29
+ for your provider (e.g. ` primary-github ` ).
30
30
31
31
Set the following environment variables to
32
32
[ configure the Coder server] ( ./configure.md ) :
33
33
34
34
``` env
35
- CODER_EXTERNAL_AUTH_0_ID="primary-github"
36
- CODER_EXTERNAL_AUTH_0_TYPE=github|gitlab|azure-devops|bitbucket|<name of service e.g. jfrog>
37
- CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx
38
- CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx
39
-
40
- # Optionally, configure a custom display name and icon
41
- CODER_EXTERNAL_AUTH_0_DISPLAY_NAME="Google Calendar"
42
- CODER_EXTERNAL_AUTH_0_DISPLAY_ICON="https://mycustomicon.com/google.svg"
35
+ CODER_GITAUTH_0_ID="primary-github"
36
+ CODER_GITAUTH_0_TYPE=github|gitlab|azure-devops|bitbucket
37
+ CODER_GITAUTH_0_CLIENT_ID=xxxxxx
38
+ CODER_GITAUTH_0_CLIENT_SECRET=xxxxxxx
43
39
```
44
40
45
41
### GitHub
@@ -73,23 +69,23 @@ CODER_EXTERNAL_AUTH_0_DISPLAY_ICON="https://mycustomicon.com/google.svg"
73
69
GitHub Enterprise requires the following authentication and token URLs:
74
70
75
71
``` env
76
- CODER_EXTERNAL_AUTH_0_VALIDATE_URL ="https://github.example.com/login/oauth/access_token/info"
77
- CODER_EXTERNAL_AUTH_0_AUTH_URL ="https://github.example.com/login/oauth/authorize"
78
- CODER_EXTERNAL_AUTH_0_TOKEN_URL ="https://github.example.com/login/oauth/access_token"
72
+ CODER_GITAUTH_0_VALIDATE_URL ="https://github.example.com/login/oauth/access_token/info"
73
+ CODER_GITAUTH_0_AUTH_URL ="https://github.example.com/login/oauth/authorize"
74
+ CODER_GITAUTH_0_TOKEN_URL ="https://github.example.com/login/oauth/access_token"
79
75
```
80
76
81
77
### Azure DevOps
82
78
83
79
Azure DevOps requires the following environment variables:
84
80
85
81
``` env
86
- CODER_EXTERNAL_AUTH_0_ID ="primary-azure-devops"
87
- CODER_EXTERNAL_AUTH_0_TYPE =azure-devops
88
- CODER_EXTERNAL_AUTH_0_CLIENT_ID =xxxxxx
82
+ CODER_GITAUTH_0_ID ="primary-azure-devops"
83
+ CODER_GITAUTH_0_TYPE =azure-devops
84
+ CODER_GITAUTH_0_CLIENT_ID =xxxxxx
89
85
# Ensure this value is your "Client Secret", not "App Secret"
90
- CODER_EXTERNAL_AUTH_0_CLIENT_SECRET =xxxxxxx
91
- CODER_EXTERNAL_AUTH_0_AUTH_URL ="https://app.vssps.visualstudio.com/oauth2/authorize"
92
- CODER_EXTERNAL_AUTH_0_TOKEN_URL ="https://app.vssps.visualstudio.com/oauth2/token"
86
+ CODER_GITAUTH_0_CLIENT_SECRET =xxxxxxx
87
+ CODER_GITAUTH_0_AUTH_URL ="https://app.vssps.visualstudio.com/oauth2/authorize"
88
+ CODER_GITAUTH_0_TOKEN_URL ="https://app.vssps.visualstudio.com/oauth2/token"
93
89
```
94
90
95
91
### Self-managed git providers
@@ -98,20 +94,20 @@ Custom authentication and token URLs should be used for self-managed Git
98
94
provider deployments.
99
95
100
96
``` env
101
- CODER_EXTERNAL_AUTH_0_AUTH_URL ="https://github.example.com/oauth/authorize"
102
- CODER_EXTERNAL_AUTH_0_TOKEN_URL ="https://github.example.com/oauth/token"
103
- CODER_EXTERNAL_AUTH_0_VALIDATE_URL ="https://your-domain.com/oauth/token/info"
97
+ CODER_GITAUTH_0_AUTH_URL ="https://github.example.com/oauth/authorize"
98
+ CODER_GITAUTH_0_TOKEN_URL ="https://github.example.com/oauth/token"
99
+ CODER_GITAUTH_0_VALIDATE_URL ="https://your-domain.com/oauth/token/info"
104
100
```
105
101
106
102
### Custom scopes
107
103
108
104
Optionally, you can request custom scopes:
109
105
110
106
``` env
111
- CODER_EXTERNAL_AUTH_0_SCOPES ="repo:read repo:write write:gpg_key"
107
+ CODER_GITAUTH_0_SCOPES ="repo:read repo:write write:gpg_key"
112
108
```
113
109
114
- ### Multiple External Providers (enterprise)
110
+ ### Multiple git providers (enterprise)
115
111
116
112
Multiple providers are an Enterprise feature. [ Learn more] ( ../enterprise.md ) .
117
113
@@ -120,21 +116,21 @@ limit auth scope. Here's a sample config:
120
116
121
117
``` env
122
118
# Provider 1) github.com
123
- CODER_EXTERNAL_AUTH_0_ID =primary-github
124
- CODER_EXTERNAL_AUTH_0_TYPE =github
125
- CODER_EXTERNAL_AUTH_0_CLIENT_ID =xxxxxx
126
- CODER_EXTERNAL_AUTH_0_CLIENT_SECRET =xxxxxxx
127
- CODER_EXTERNAL_AUTH_0_REGEX =github.com/orgname
119
+ CODER_GITAUTH_0_ID =primary-github
120
+ CODER_GITAUTH_0_TYPE =github
121
+ CODER_GITAUTH_0_CLIENT_ID =xxxxxx
122
+ CODER_GITAUTH_0_CLIENT_SECRET =xxxxxxx
123
+ CODER_GITAUTH_0_REGEX =github.com/orgname
128
124
129
125
# Provider 2) github.example.com
130
- CODER_EXTERNAL_AUTH_1_ID =secondary-github
131
- CODER_EXTERNAL_AUTH_1_TYPE =github
132
- CODER_EXTERNAL_AUTH_1_CLIENT_ID =xxxxxx
133
- CODER_EXTERNAL_AUTH_1_CLIENT_SECRET =xxxxxxx
134
- CODER_EXTERNAL_AUTH_1_REGEX =github.example.com
135
- CODER_EXTERNAL_AUTH_1_AUTH_URL ="https://github.example.com/login/oauth/authorize"
136
- CODER_EXTERNAL_AUTH_1_TOKEN_URL ="https://github.example.com/login/oauth/access_token"
137
- CODER_EXTERNAL_AUTH_1_VALIDATE_URL ="https://github.example.com/login/oauth/access_token/info"
126
+ CODER_GITAUTH_1_ID =secondary-github
127
+ CODER_GITAUTH_1_TYPE =github
128
+ CODER_GITAUTH_1_CLIENT_ID =xxxxxx
129
+ CODER_GITAUTH_1_CLIENT_SECRET =xxxxxxx
130
+ CODER_GITAUTH_1_REGEX =github.example.com
131
+ CODER_GITAUTH_1_AUTH_URL ="https://github.example.com/login/oauth/authorize"
132
+ CODER_GITAUTH_1_TOKEN_URL ="https://github.example.com/login/oauth/access_token"
133
+ CODER_GITAUTH_1_VALIDATE_URL ="https://github.example.com/login/oauth/access_token/info"
138
134
```
139
135
140
136
To support regex matching for paths (e.g. github.com/orgname), you'll need to
0 commit comments