Skip to content

Commit 7dc3f5f

Browse files
authored
init: oauth docs (coder#2565)
* init: oauth docs * chore: update directories * update: feedback
1 parent 69b7eed commit 7dc3f5f

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

docs/install/oauth.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# GitHub OAuth
2+
3+
By default, Coder is accessible via built-in authentication. Alternatively, you
4+
can configure Coder to enable logging in through GitHub OAuth. See below for
5+
configuration steps.
6+
7+
## Step 1: Configure the OAuth application in GitHub
8+
9+
First, [https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/](register a GitHub OAuth app). GitHub will ask you for the following Coder parameters:
10+
11+
- **Homepage URL**: Set to your Coder domain (e.g. `https://coder.domain.com`)
12+
- **User Authorization Callback URL**: Set to `https://coder.domain.com/api/v2/users/oauth2/github/callback`
13+
14+
Note the Client ID and Client Secret generated by GitHub. You will use these
15+
values in the next step.
16+
17+
## Step 2: Configure Coder with the OAuth credentials
18+
19+
Navigate to your Coder host and run the following command to start up the Coder
20+
server:
21+
22+
```console
23+
coder server --oauth2-github-allow-signups=true --oauth2-github-allowed-orgs="your-org" --oauth2-github-client-id="8d1...e05" --oauth2-github-client-secret="57ebc9...02c24c"
24+
```
25+
26+
Alternatively, if you are running Coder as a system service, you can achieve the
27+
same result as the command above by adding the following environment variables
28+
to the `/etc/coder.d/coder.env` file:
29+
30+
```console
31+
CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS=true
32+
CODER_OAUTH2_GITHUB_ALLOWED_ORGS="your-org"
33+
CODER_OAUTH2_GITHUB_CLIENT_ID="8d1...e05"
34+
CODER_OAUTH2_GITHUB_CLIENT_SECRET="57ebc9...02c24c"
35+
```
36+
37+
Once complete, run `sudo service coder restart` to reboot Coder.
File renamed without changes.

docs/manifest.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@
2525
"children": [
2626
{
2727
"title": "Postgres",
28-
"description": "Learn how to create and use your own Postgres database",
29-
"path": "./postgres.md"
30-
}
28+
"description": "Learn how to create and use your own Postgres database.",
29+
"path": "./install/postgres.md"
30+
},
31+
{
32+
"title": "GitHub OAuth",
33+
"description": "Learn how to set up OAuth using your GitHub organization.",
34+
"path": "./install/oauth.md"
35+
}
3136
]
3237
},
3338
{

0 commit comments

Comments
 (0)