Skip to content

Commit be6e734

Browse files
committed
drop external keycloak in favor of generic oidc issuer
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
1 parent ff47763 commit be6e734

File tree

4 files changed

+32
-44
lines changed

4 files changed

+32
-44
lines changed

charts/opencloud/README.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ This will prepend `my-registry.com/` to all image references in the chart. For e
224224
| `global.domain.wopi` | Domain for WOPI server | `wopiserver.opencloud.test` |
225225
| `global.tls.enabled` | Enable TLS (set to false when using gateway TLS termination externally) | `false` |
226226
| `global.tls.secretName` | secretName for TLS certificate | `""` |
227+
| `global.oidc.issuer` | OpenID Connect Issuer URL | `""` generated to use the internal keycloak|
228+
| `global.oidc.clientId` | OpenID Connect Client ID used by OpenCloud | `"web"` |
227229
| `global.storage.storageClass` | Storage class for persistent volumes | `""` |
228230
| `global.image.registry` | Global registry override for all images (e.g., `my-registry.com`) | `""` |
229231
| `global.image.pullPolicy` | Global pull policy override for all images (`Always`, `IfNotPresent`, `Never`) | `""` |
@@ -275,7 +277,7 @@ This will prepend `my-registry.com/` to all image references in the chart. For e
275277

276278
### Keycloak Settings
277279

278-
Keycloak configuration follows the standardized internal/external pattern (see issue #64).
280+
By default the chart deploys an internal keycloak. It can be disabled and replaced with an external IdP.
279281

280282
#### Internal Keycloak
281283

@@ -295,29 +297,20 @@ Keycloak configuration follows the standardized internal/external pattern (see i
295297

296298
> **Note**: When using internal Keycloak with multiple OpenCloud replicas (`opencloud.replicas > 1`), you must use an external shared database or LDAP. The embedded IDM does not support replication. See [issue #53](https://github.com/opencloud-eu/helm/issues/53) for details.
297299
298-
#### External Keycloak
299-
300-
| Parameter | Description | Default |
301-
| --------- | ----------- | ------- |
302-
| `keycloak.external.enabled` | Enable external Keycloak | `false` |
303-
| `keycloak.external.url` | External Keycloak URL (without /realms/...) | `""` |
304-
| `keycloak.external.realm` | External Keycloak realm | `openCloud` |
305-
| `keycloak.external.clientId` | External Keycloak client ID | `web` |
306-
307-
#### Example: Using External Keycloak
300+
#### Example: Using External IDP
308301

309302
```yaml
303+
global:
304+
oidc:
305+
issuer: "https://idp.example.com/realms/openCloud"
306+
clientId: "opencloud-web"
307+
310308
keycloak:
311309
internal:
312310
enabled: false
313-
external:
314-
enabled: true
315-
url: "https://keycloak.example.com"
316-
realm: "my-realm"
317-
clientId: "opencloud-web"
318311
```
319312
320-
**Note**: Only one of `keycloak.internal.enabled` or `keycloak.external.enabled` should be set to `true`.
313+
**Note**: If `keycloak.internal.enabled` is `true`, the `global.oidc.issuer` should be left empty to not override the generated issuer URL.
321314

322315
### PostgreSQL Settings
323316

charts/opencloud/templates/gateway/keycloak-https-httproute.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.httpRoute.enabled .Values.keycloak.enabled (not .Values.keycloak.external.enabled) }}
1+
{{- if and .Values.httpRoute.enabled .Values.keycloak.internal.enabled }}
22
apiVersion: gateway.networking.k8s.io/v1beta1
33
kind: HTTPRoute
44
metadata:

charts/opencloud/templates/opencloud/deployment.yaml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -200,26 +200,25 @@ spec:
200200
- name: NOTIFICATIONS_SMTP_ENCRYPTION
201201
value: "{{ .Values.opencloud.smtp.encryption }}"
202202
{{- end }}
203-
{{- if or .Values.keycloak.internal.enabled .Values.keycloak.external.enabled }}
204-
# Keycloak IDP specific configuration
203+
{{- if or .Values.keycloak.internal.enabled .Values.global.oidc.issuer }}
204+
# IDP specific configuration
205205
- name: PROXY_AUTOPROVISION_ACCOUNTS
206206
value: "true"
207+
# user properties are edited in the idp, so we hate to make them readonly
208+
- name: FRONTEND_READONLY_USER_ATTRIBUTES
209+
value: "user.onPremisesSamAccountName,user.displayName,user.mail,user.passwordProfile,user.accountEnabled,user.appRoleAssignments"
207210
- name: PROXY_ROLE_ASSIGNMENT_DRIVER
208211
value: "oidc"
209212
- name: OC_OIDC_ISSUER
210-
{{- if .Values.keycloak.external.enabled }}
211-
value: "{{ .Values.keycloak.external.url }}/realms/{{ .Values.keycloak.external.realm }}"
213+
{{- if .Values.global.oidc.issuer }}
214+
value: {{ .Values.global.oidc.issuer | quote }}
212215
{{- else }}
213-
value: "https://{{ include "opencloud.keycloak.domain" . }}/realms/{{ .Values.keycloak.internal.realm }}"
216+
value: {{ printf "https://%s/realms/%s" (include "opencloud.keycloak.domain" .) .Values.keycloak.internal.realm | quote }}
214217
{{- end }}
215218
- name: PROXY_OIDC_REWRITE_WELLKNOWN
216219
value: "true"
217220
- name: WEB_OIDC_CLIENT_ID
218-
{{- if .Values.keycloak.external.enabled }}
219-
value: "{{ .Values.keycloak.external.clientId }}"
220-
{{- else }}
221-
value: "web"
222-
{{- end }}
221+
value: {{ .Values.global.oidc.clientId | quote}}
223222
- name: PROXY_USER_OIDC_CLAIM
224223
value: "preferred_username"
225224
- name: PROXY_USER_CS3_CLAIM
@@ -230,16 +229,15 @@ spec:
230229
value: "false"
231230
- name: GRAPH_USERNAME_MATCH
232231
value: "none"
233-
# Additional OIDC settings from docker-compose
234232
- name: PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM
235233
value: "roles"
236234
- name: PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD
237235
value: "jwt"
238236
- name: WEB_OIDC_METADATA_URL
239-
{{- if .Values.keycloak.external.enabled }}
240-
value: "{{ .Values.keycloak.external.url }}/realms/{{ .Values.keycloak.external.realm }}/.well-known/openid-configuration"
237+
{{- if .Values.global.oidc.issuer }}
238+
value: {{ printf "%s/.well-known/openid-configuration" .Values.global.oidc.issuer | quote }}
241239
{{- else }}
242-
value: "https://{{ include "opencloud.keycloak.domain" . }}/realms/{{ .Values.keycloak.internal.realm }}/.well-known/openid-configuration"
240+
value: {{ printf "https://%s/realms/%s/.well-known/openid-configuration" (include "opencloud.keycloak.domain" .) .Values.keycloak.internal.realm | quote }}
243241
{{- end }}
244242
- name: WEB_OIDC_SCOPE
245243
value: "openid profile email groups roles"

charts/opencloud/values.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,19 @@ global:
4747
# secretName for TLS certificate
4848
secretName: ""
4949

50+
oidc:
51+
# OpenID Connect issuer URL. If set, overrides the default Keycloak internal issuer URL.
52+
# This is useful for external OIDC providers or custom Keycloak configurations.
53+
# Example: https://keycloak.opencloud.test/realms/openCloud
54+
issuer: ""
55+
# OIDC client ID for OpenCloud
56+
clientId: "web"
57+
5058
# Global storage settings
5159
storage:
5260
# Storage class for persistent volumes
5361
storageClass: ""
54-
62+
5563
# Global image settings
5664
image:
5765
# Global registry override - if set, it will override all image registries
@@ -126,17 +134,6 @@ keycloak:
126134
maxAge: "3600"
127135
# Resources
128136
resources: {}
129-
130-
# External Keycloak connection
131-
external:
132-
# Enable external Keycloak
133-
enabled: false
134-
# External Keycloak URL (without /realms/...)
135-
url: ""
136-
# External Keycloak realm
137-
realm: "openCloud"
138-
# External Keycloak client ID
139-
clientId: "web"
140137

141138
# PostgreSQL settings for Keycloak
142139
postgres:

0 commit comments

Comments
 (0)