1
- # Git Providers
1
+ # External Authentication
2
2
3
- Coder integrates with git providers to automate away the need for developers to
4
- authenticate with repositories within their workspace.
3
+ Coder integrates with Git and OpenID Connect to automate away the need for
4
+ developers to authenticate with external services within their workspace.
5
5
6
- ## How it works
6
+ ## Git Providers
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
@@ -16,26 +16,30 @@ Your browser does not support the video tag.
16
16
17
17
## Configuration
18
18
19
- To add a git provider, you'll need to create an OAuth application. The following
20
- providers are supported:
19
+ To add an external authentication provider, you'll need to create an OAuth
20
+ application. The following providers are supported:
21
21
22
- - [ GitHub] ( #github-app )
22
+ - [ GitHub] ( #github )
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/gitauth /primary-github/callback ` . Use an arbitrary ID
29
- for your provider (e.g. ` primary-github ` ).
28
+ ` https://coder.example.com/external-auth /primary-github/callback ` . Use an
29
+ arbitrary ID 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_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
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"
39
43
```
40
44
41
45
### GitHub
@@ -69,23 +73,23 @@ CODER_GITAUTH_0_CLIENT_SECRET=xxxxxxx
69
73
GitHub Enterprise requires the following authentication and token URLs:
70
74
71
75
``` env
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"
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"
75
79
```
76
80
77
81
### Azure DevOps
78
82
79
83
Azure DevOps requires the following environment variables:
80
84
81
85
``` env
82
- CODER_GITAUTH_0_ID ="primary-azure-devops"
83
- CODER_GITAUTH_0_TYPE =azure-devops
84
- CODER_GITAUTH_0_CLIENT_ID =xxxxxx
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
85
89
# Ensure this value is your "Client Secret", not "App Secret"
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"
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"
89
93
```
90
94
91
95
### Self-managed git providers
@@ -94,20 +98,20 @@ Custom authentication and token URLs should be used for self-managed Git
94
98
provider deployments.
95
99
96
100
``` env
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"
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"
100
104
```
101
105
102
106
### Custom scopes
103
107
104
108
Optionally, you can request custom scopes:
105
109
106
110
``` env
107
- CODER_GITAUTH_0_SCOPES ="repo:read repo:write write:gpg_key"
111
+ CODER_EXTERNAL_AUTH_0_SCOPES ="repo:read repo:write write:gpg_key"
108
112
```
109
113
110
- ### Multiple git providers (enterprise)
114
+ ### Multiple External Providers (enterprise)
111
115
112
116
Multiple providers are an Enterprise feature. [ Learn more] ( ../enterprise.md ) .
113
117
@@ -116,21 +120,21 @@ limit auth scope. Here's a sample config:
116
120
117
121
``` env
118
122
# Provider 1) github.com
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
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
124
128
125
129
# Provider 2) github.example.com
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"
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"
134
138
```
135
139
136
140
To support regex matching for paths (e.g. github.com/orgname), you'll need to
0 commit comments