Skip to content

Commit c7efac0

Browse files
authored
Enable DPoP if the AS supports it, unless the Go Onboarding API is en… (#1055)
1 parent 5fc19ec commit c7efac0

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

helm-chart/templates/web/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ spec:
4141
value: {{ $value | quote }}
4242
{{- end -}}
4343
{{- end }}
44+
{{- if .Values.onboarding.enabled }}
45+
- name: OIDC_DISABLE_DPOP
46+
value: "true"
47+
{{- end }}
4448
ports:
4549
- name: http
4650
containerPort: {{ .Values.web.containerPort }}

web/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,3 +887,6 @@ ONYXIA_VERSION_URL=
887887
SCREEN_SCALER=true
888888

889889
OIDC_DEBUG_LOGS=false
890+
891+
# NOTE: Temporary workaround until the Go onboarding API supports it.
892+
OIDC_DISABLE_DPOP=false

web/src/main.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@ if (import.meta.env.DEV) {
1818
return;
1919
}
2020

21-
const [{ oidcEarlyInit }, { browserRuntimeFreeze }] = await Promise.all([
21+
const [{ oidcEarlyInit }, { browserRuntimeFreeze }, { DPoP }] = await Promise.all([
2222
import("oidc-spa/entrypoint"),
23-
import("oidc-spa/browser-runtime-freeze")
23+
import("oidc-spa/browser-runtime-freeze"),
24+
import.meta.env.OIDC_DISABLE_DPOP === "true"
25+
? { DPoP: undefined }
26+
: import("oidc-spa/DPoP")
2427
]);
2528

2629
const { shouldLoadApp } = oidcEarlyInit({
2730
BASE_URL: import.meta.env.BASE_URL,
2831
securityDefenses: {
29-
...browserRuntimeFreeze()
32+
...browserRuntimeFreeze(),
33+
...DPoP?.({ mode: "auto" })
3034
}
3135
});
3236

web/src/vite-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ type ImportMetaEnv = {
6666
ONYXIA_VERSION_URL: string
6767
SCREEN_SCALER: string
6868
OIDC_DEBUG_LOGS: string
69+
OIDC_DISABLE_DPOP: string
6970
// @user-defined-start
7071
/*
7172
* Here you can define your own special variables

0 commit comments

Comments
 (0)