From f82fbbd87ad98e94a5c54c7d3765e3142d8e85a7 Mon Sep 17 00:00:00 2001 From: kqmaverick <121722567+kqmaverick@users.noreply.github.com> Date: Sat, 13 Apr 2024 16:37:40 -0700 Subject: [PATCH] feat(authelia): add pkce for oidc (#20306) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Adds PKCE for OpenID Connect 1.0 https://www.authelia.com/configuration/identity-providers/openid-connect/clients/#require_pkce ⚒️ Fixes # **⚙️ Type of change** - [X] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [X] ⬆️ I increased versions for any altered app according to semantic versioning - [X] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):` or `chore(chart-name):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/premium/authelia/Chart.yaml | 2 +- charts/premium/authelia/questions.yaml | 19 +++++++++++++++++++ .../premium/authelia/templates/_configmap.tpl | 6 ++++++ charts/premium/authelia/values.yaml | 6 ++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/charts/premium/authelia/Chart.yaml b/charts/premium/authelia/Chart.yaml index 0f209974885..7671a539eb3 100644 --- a/charts/premium/authelia/Chart.yaml +++ b/charts/premium/authelia/Chart.yaml @@ -51,4 +51,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/premium/authelia - https://ghcr.io/authelia/authelia type: application -version: 23.11.10 +version: 23.12.0 diff --git a/charts/premium/authelia/questions.yaml b/charts/premium/authelia/questions.yaml index ab50fb0097a..e5276beb285 100644 --- a/charts/premium/authelia/questions.yaml +++ b/charts/premium/authelia/questions.yaml @@ -1142,6 +1142,25 @@ questions: type: string default: "form_post" required: true + - variable: require_pkce + label: "Require PKCE" + description: "This configuration option enforces the use of PKCE for this registered client." + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: pkce_challange_method + label: "PKCE Challange Method" + description: "This setting enforces the use of the specified PKCE challenge method for this individual client." + schema: + type: string + default: S256 + enum: + - value: "plain" + description: "plain" + - value: "S256" + description: "S256" # Include{addons} # Include{codeserver} # Include{vpn} diff --git a/charts/premium/authelia/templates/_configmap.tpl b/charts/premium/authelia/templates/_configmap.tpl index c2797c8aaaa..c1bdd5de1c9 100644 --- a/charts/premium/authelia/templates/_configmap.tpl +++ b/charts/premium/authelia/templates/_configmap.tpl @@ -280,6 +280,12 @@ data: {{- end }} {{- end }} userinfo_signing_algorithm: {{ $client.userinfo_signing_algorithm | default "none" }} + {{- if $client.require_pkce }} + require_pkce: {{ $client.require_pkce }} + {{- end }} + {{- if $client.pkce_challange_method }} + pkce_challenge_method: {{ $client.require_pkce.pkce_challange_method | default "S256" }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/charts/premium/authelia/values.yaml b/charts/premium/authelia/values.yaml index 9f1cb548b90..c9b82260e9f 100644 --- a/charts/premium/authelia/values.yaml +++ b/charts/premium/authelia/values.yaml @@ -573,6 +573,12 @@ identity_providers: ## The algorithm used to sign userinfo endpoint responses for this client, either none or RS256. # userinfo_signing_algorithm: none +## This configuration option enforces the use of PKCE for this registered client. +# require_pkce: false + +## This setting enforces the use of the specified PKCE challenge method for this individual client. +# pkce_challange_method: S256 + portal: open: enabled: true