Skip to content

docs: update external auth to better explain process #15970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Muhammad Atif Ali <me@matifali.dev>
  • Loading branch information
ChristopherJTrent and matifali authored Jan 2, 2025
commit 45ad599ced1ff9edfb4634ba454a03df095f197b
36 changes: 1 addition & 35 deletions docs/admin/external-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ application. The following providers are supported:

The next step is to configure the Coder server to use the OAuth application by
setting the following environment variables:
<div class="tabs">

## Environment Variables
## Configuration

```env
CODER_EXTERNAL_AUTH_0_ID="<USER_DEFINED_ID>"
Expand All @@ -29,44 +28,11 @@ The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used for internal
reference. Therefore, it can be set arbitrarily (e.g., `primary-github` for your
GitHub provider).

## Docker Compose

```yaml
services:
coder:
environment:
CODER_EXTERNAL_AUTH_0_ID: <USER_DEFINED_ID>
CODER_EXTERNAL_AUTH_0_TYPE: <github|gitlab|azure-devops|bitbucket-cloud|bitbucket-server|etc>
CODER_EXTERNAL_AUTH_0_CLIENT_ID: <OAuth app client ID>
CODER_EXTERNAL_AUTH_0_CLIENT_SECRET: <OAuth app client secret>
```

The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used for internal
reference. Therefore, it can be set arbitrarily (e.g., `primary-github` for your
GitHub provider).

## Docker CLI

```sh
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
docker run --rm -it \
-e CODER_ACCESS_URL="https://coder.example.com" \
-e CODER_PG_CONECTION_URL="postgresql://username:password@database/coder" \
-e CODER_EXTERNAL_AUTH_0_ID="<USER_DEFINED_ID>" \
-e CODER_EXTERNAL_AUTH_0_TYPE="<github|gitlab|azure-devops|bitbucket-cloud|bitbucket-server|etc>" \
-e CODER_EXTERNAL_AUTH_0_CLIENT_ID="<OAuth app client ID>" \
-e CODER_EXTERNAL_AUTH_0_CLIENT_SECRET="<OAuth app client secret>" \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add $DOCKER_GROUP \
ghcr.io/coder/coder:latest
```

The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used for internal
reference. Therefore, it can be set arbitrarily (e.g., `primary-github` for your
GitHub provider).

</div>

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.

```tf
Expand Down
Loading