Skip to content

Commit e6c047c

Browse files
committed
Change the name of external auth
1 parent c4b0fa0 commit e6c047c

File tree

8 files changed

+80
-69
lines changed

8 files changed

+80
-69
lines changed

docs/admin/git-providers.md renamed to docs/admin/external-auth.md

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,45 @@
1-
# Git Providers
1+
# External Authentication
22

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.
55

6-
## How it works
6+
## Git Providers
77

88
When developers use `git` inside their workspace, they are prompted to
99
authenticate. After that, Coder will store and refresh tokens for future
1010
operations.
1111

1212
<video autoplay playsinline loop>
13-
<source src="https://github.com/coder/coder/blob/main/site/static/gitauth.mp4?raw=true" type="video/mp4">
13+
<source src="https://github.com/coder/coder/blob/main/site/static/external-auth.mp4?raw=true" type="video/mp4">
1414
Your browser does not support the video tag.
1515
</video>
1616

1717
## Configuration
1818

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:
2121

22-
- [GitHub](#github-app)
22+
- [GitHub](#github)
2323
- [GitLab](https://docs.gitlab.com/ee/integration/oauth_provider.html)
2424
- [BitBucket](https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/)
2525
- [Azure DevOps](https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops)
2626

2727
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`).
3030

3131
Set the following environment variables to
3232
[configure the Coder server](./configure.md):
3333

3434
```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|oidc
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"
3943
```
4044

4145
### GitHub
@@ -69,23 +73,23 @@ CODER_GITAUTH_0_CLIENT_SECRET=xxxxxxx
6973
GitHub Enterprise requires the following authentication and token URLs:
7074

7175
```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"
7579
```
7680

7781
### Azure DevOps
7882

7983
Azure DevOps requires the following environment variables:
8084

8185
```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
8589
# 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"
8993
```
9094

9195
### Self-managed git providers
@@ -94,17 +98,17 @@ Custom authentication and token URLs should be used for self-managed Git
9498
provider deployments.
9599

96100
```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"
100104
```
101105

102106
### Custom scopes
103107

104108
Optionally, you can request custom scopes:
105109

106110
```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"
108112
```
109113

110114
### Multiple git providers (enterprise)
@@ -116,21 +120,21 @@ limit auth scope. Here's a sample config:
116120

117121
```env
118122
# 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
124128
125129
# 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"
134138
```
135139

136140
To support regex matching for paths (e.g. github.com/orgname), you'll need to

docs/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@
308308
"icon_path": "./images/icons/toggle_on.svg"
309309
},
310310
{
311-
"title": "Git Providers",
312-
"description": "Learn how connect Coder with external git providers",
313-
"path": "./admin/git-providers.md",
311+
"title": "External Auth",
312+
"description": "Learn how connect Coder with external auth providers",
313+
"path": "./admin/external-auth.md",
314314
"icon_path": "./images/icons/git.svg"
315315
},
316316
{

site/src/AppRouter.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ const UserAuthSettingsPage = lazy(
110110
"./pages/DeploySettingsPage/UserAuthSettingsPage/UserAuthSettingsPage"
111111
),
112112
);
113-
const GitAuthSettingsPage = lazy(
113+
const ExternalAuthSettingsPage = lazy(
114114
() =>
115115
import(
116-
"./pages/DeploySettingsPage/GitAuthSettingsPage/GitAuthSettingsPage"
116+
"./pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPage"
117117
),
118118
);
119119
const NetworkSettingsPage = lazy(
@@ -292,7 +292,10 @@ export const AppRouter: FC = () => {
292292
<Route path="appearance" element={<AppearanceSettingsPage />} />
293293
<Route path="network" element={<NetworkSettingsPage />} />
294294
<Route path="userauth" element={<UserAuthSettingsPage />} />
295-
<Route path="gitauth" element={<GitAuthSettingsPage />} />
295+
<Route
296+
path="external-auth"
297+
element={<ExternalAuthSettingsPage />}
298+
/>
296299
<Route
297300
path="workspace-proxies"
298301
element={<WorkspaceProxyPage />}

site/src/pages/DeploySettingsPage/GitAuthSettingsPage/GitAuthSettingsPage.tsx renamed to site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import { useDeploySettings } from "components/DeploySettingsLayout/DeploySetting
22
import { FC } from "react";
33
import { Helmet } from "react-helmet-async";
44
import { pageTitle } from "utils/page";
5-
import { GitAuthSettingsPageView } from "./GitAuthSettingsPageView";
5+
import { ExternalAuthSettingsPageView } from "./ExternalAuthSettingsPageView";
66

7-
const GitAuthSettingsPage: FC = () => {
7+
const ExternalAuthSettingsPage: FC = () => {
88
const { deploymentValues: deploymentValues } = useDeploySettings();
99

1010
return (
1111
<>
1212
<Helmet>
13-
<title>{pageTitle("Git Authentication Settings")}</title>
13+
<title>{pageTitle("External Authentication Settings")}</title>
1414
</Helmet>
1515

16-
<GitAuthSettingsPageView config={deploymentValues.config} />
16+
<ExternalAuthSettingsPageView config={deploymentValues.config} />
1717
</>
1818
);
1919
};
2020

21-
export default GitAuthSettingsPage;
21+
export default ExternalAuthSettingsPage;

site/src/pages/DeploySettingsPage/GitAuthSettingsPage/GitAuthSettingsPageView.stories.tsx renamed to site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPageView.stories.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { GitAuthSettingsPageView } from "./GitAuthSettingsPageView";
1+
import { ExternalAuthSettingsPageView } from "./ExternalAuthSettingsPageView";
22
import type { Meta, StoryObj } from "@storybook/react";
33

4-
const meta: Meta<typeof GitAuthSettingsPageView> = {
5-
title: "pages/GitAuthSettingsPageView",
6-
component: GitAuthSettingsPageView,
4+
const meta: Meta<typeof ExternalAuthSettingsPageView> = {
5+
title: "pages/ExternalAuthSettingsPageView",
6+
component: ExternalAuthSettingsPageView,
77
args: {
88
config: {
9-
git_auth: [
9+
external_auth: [
1010
{
1111
id: "0000-1111",
1212
type: "GitHub",
@@ -30,6 +30,6 @@ const meta: Meta<typeof GitAuthSettingsPageView> = {
3030
};
3131

3232
export default meta;
33-
type Story = StoryObj<typeof GitAuthSettingsPageView>;
33+
type Story = StoryObj<typeof ExternalAuthSettingsPageView>;
3434

3535
export const Page: Story = {};

site/src/pages/DeploySettingsPage/GitAuthSettingsPage/GitAuthSettingsPageView.tsx renamed to site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPageView.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ import TableCell from "@mui/material/TableCell";
55
import TableContainer from "@mui/material/TableContainer";
66
import TableHead from "@mui/material/TableHead";
77
import TableRow from "@mui/material/TableRow";
8-
import { DeploymentValues, GitAuthConfig } from "api/typesGenerated";
8+
import { DeploymentValues, ExternalAuthConfig } from "api/typesGenerated";
99
import { Alert } from "components/Alert/Alert";
1010
import { EnterpriseBadge } from "components/DeploySettingsLayout/Badges";
1111
import { Header } from "components/DeploySettingsLayout/Header";
1212
import { docs } from "utils/docs";
1313

14-
export type GitAuthSettingsPageViewProps = {
14+
export type ExternalAuthSettingsPageViewProps = {
1515
config: DeploymentValues;
1616
};
1717

18-
export const GitAuthSettingsPageView = ({
18+
export const ExternalAuthSettingsPageView = ({
1919
config,
20-
}: GitAuthSettingsPageViewProps): JSX.Element => {
20+
}: ExternalAuthSettingsPageViewProps): JSX.Element => {
2121
const styles = useStyles();
2222

2323
return (
2424
<>
2525
<Header
26-
title="Git Authentication"
27-
description="Coder integrates with GitHub, GitLab, BitBucket, and Azure Repos to authenticate developers with your Git provider."
28-
docsHref={docs("/admin/git-providers")}
26+
title="External Authentication"
27+
description="Coder integrates with GitHub, GitLab, BitBucket, Azure Repos, and OpenID Connect to authenticate developers with external services."
28+
docsHref={docs("/admin/external-auth")}
2929
/>
3030

3131
<video
3232
autoPlay
3333
muted
3434
loop
3535
playsInline
36-
src="/gitauth.mp4"
36+
src="/external-auth.mp4"
3737
style={{
3838
maxWidth: "100%",
3939
borderRadius: 4,
@@ -42,7 +42,8 @@ export const GitAuthSettingsPageView = ({
4242

4343
<div className={styles.description}>
4444
<Alert severity="info" actions={<EnterpriseBadge key="enterprise" />}>
45-
Integrating with multiple Git providers is an Enterprise feature.
45+
Integrating with multiple External authentication providers is an
46+
Enterprise feature.
4647
</Alert>
4748
</div>
4849

@@ -56,7 +57,8 @@ export const GitAuthSettingsPageView = ({
5657
</TableRow>
5758
</TableHead>
5859
<TableBody>
59-
{((config.git_auth === null || config.git_auth?.length === 0) && (
60+
{((config.external_auth === null ||
61+
config.external_auth?.length === 0) && (
6062
<TableRow>
6163
<TableCell colSpan={999}>
6264
<div className={styles.empty}>
@@ -65,7 +67,7 @@ export const GitAuthSettingsPageView = ({
6567
</TableCell>
6668
</TableRow>
6769
)) ||
68-
config.git_auth?.map((git: GitAuthConfig) => {
70+
config.external_auth?.map((git: ExternalAuthConfig) => {
6971
const name = git.id || git.type;
7072
return (
7173
<TableRow key={name}>

site/src/pages/ExternalAuthPage/ExternalAuthPageView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ const ExternalAuthPageView: FC<ExternalAuthPageViewProps> = ({
6767

6868
return (
6969
<SignInLayout>
70-
<Welcome message={`You've authenticated with ${externalAuth.display_name}!`} />
70+
<Welcome
71+
message={`You've authenticated with ${externalAuth.display_name}!`}
72+
/>
7173
<p className={styles.text}>
7274
{externalAuth.user?.login && `Hey @${externalAuth.user?.login}! 👋 `}
7375
{(!externalAuth.app_installable ||
File renamed without changes.

0 commit comments

Comments
 (0)