Skip to content

Commit cb4b578

Browse files
committed
chore: add pki oidc client creds docs
1 parent e94ebea commit cb4b578

File tree

1 file changed

+69
-2
lines changed

1 file changed

+69
-2
lines changed

docs/admin/auth.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ Your OIDC provider will ask you for the following parameter:
9494

9595
- **Redirect URI**: Set to `https://coder.domain.com/api/v2/users/oidc/callback`
9696

97-
### Step 2: Configure Coder with the OpenID Connect credentials
97+
### Step 2 (Client Secret Auth): Configure Coder with the OpenID Connect credentials
9898

99-
Navigate to your Coder host and run the following command to start up the Coder
99+
The most common way to authenticate with OIDC providers is with a `client_secret`. Navigate to your Coder host and run the following command to start up the Coder
100100
server:
101101

102102
```console
@@ -138,6 +138,73 @@ To upgrade Coder, run:
138138
helm upgrade <release-name> coder-v2/coder -n <namespace> -f values.yaml
139139
```
140140

141+
### Step 2 (JWT/PKI/Certificate Auth): Configure Coder with the OpenID Connect credentials
142+
143+
<blockquote class="warning">
144+
<p>
145+
Only <b>Azure AD</b> has been tested with this method. Other OIDC providers may not work, as most providers add additional requirements ontop of the standard that must be implemented. If you are using another provider and run into issues, please leave an issue on our <a href="https://github.com/coder/coder/issues">Github</a>.
146+
</p>
147+
</blockquote>
148+
149+
An alternative authentication method is to use signed JWT tokens rather than a shared `client_secret`. This requires 2 files.
150+
- An RSA private key file
151+
- ```text
152+
-----BEGIN RSA PRIVATE KEY-----
153+
... Base64 encoded key ...
154+
-----END RSA PRIVATE KEY-----
155+
```
156+
- The corresponding x509 certificate file
157+
- ```text
158+
-----BEGIN CERTIFICATE-----
159+
... Base64 encoded x509 cert ...
160+
-----END CERTIFICATE-----
161+
```
162+
163+
You must upload the public key (the certificate) to your OIDC provider.
164+
Reference the documentation provided by your provider on how to do this. Depending on the provider, the name for this feature varies.
165+
166+
- <!-- Azure --> Authentication certificate credentials
167+
- <!-- Okta --> JWT for Client Authentication
168+
- <!-- Auth0 --> Authenticate with Private Key JWT
169+
170+
171+
Once the key and certificate are uploaded, you can run Coder with the files. Navigate to your Coder host and run the following command to start up the Coder server:
172+
173+
```console
174+
coder server --oidc-issuer-url="https://issuer.corp.com" --oidc-email-domain="your-domain-1,your-domain-2" --oidc-client-key-file="/path/to/key.pem" --oidc-client-cert-file="/path/to/cert.pem"
175+
```
176+
177+
If you are running Coder as a system service, you can achieve the same result as the command above by adding the following environment variables to the /etc/coder.d/coder.env file:
178+
179+
```console
180+
CODER_OIDC_ISSUER_URL="https://issuer.corp.com"
181+
CODER_OIDC_EMAIL_DOMAIN="your-domain-1,your-domain-2"
182+
CODER_OIDC_CLIENT_KEY_FILE="/path/to/key.pem"
183+
CODER_OIDC_CLIENT_CERT_FILE="/path/to/cert.pem"
184+
```
185+
186+
Once complete, run sudo service coder restart to reboot Coder.
187+
188+
If deploying Coder via Helm, you can set the above environment variables in the values.yaml file as such:
189+
190+
```yaml
191+
coder:
192+
env:
193+
- name: CODER_OIDC_ISSUER_URL
194+
value: "https://issuer.corp.com"
195+
- name: CODER_OIDC_EMAIL_DOMAIN
196+
value: "your-domain-1,your-domain-2"
197+
- name: CODER_OIDC_CLIENT_KEY_FILE
198+
value: "/path/to/key.pem"
199+
- name: CODER_OIDC_CLIENT_CERT_FILE
200+
value: "/path/to/cert.pem"
201+
```
202+
203+
To upgrade Coder, run:
204+
```console
205+
helm upgrade <release-name> coder-v2/coder -n <namespace> -f values.yaml
206+
```
207+
141208
## OIDC Claims
142209

143210
When a user logs in for the first time via OIDC, Coder will merge both

0 commit comments

Comments
 (0)