From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 609F01FF146 for ; Tue, 09 Jun 2026 14:22:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F0D88F672; Tue, 9 Jun 2026 14:22:18 +0200 (CEST) From: Shannon Sterz To: pmg-devel@lists.proxmox.com Subject: [PATCH pmg-api v6 2/3] fix #5076: auth: openid: add support for an optional "audiences" field Date: Tue, 9 Jun 2026 14:22:13 +0200 Message-ID: <20260609122214.271422-3-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260609122214.271422-1-s.sterz@proxmox.com> References: <20260609122214.271422-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1781007691087 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.109 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: PBKZZCDDIYBRGJONVGGARDFMFYBYZEF2 X-Message-ID-Hash: PBKZZCDDIYBRGJONVGGARDFMFYBYZEF2 X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: adds an optional "audiences" field to the open id configuration schema. "audiences" is a list of additionally accepted audiences that an open id provider may include. Signed-off-by: Shannon Sterz --- src/PMG/API2/OIDC.pm | 4 ++++ src/PMG/Auth/OIDC.pm | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/src/PMG/API2/OIDC.pm b/src/PMG/API2/OIDC.pm index 7ea8f8c..f6fbe63 100644 --- a/src/PMG/API2/OIDC.pm +++ b/src/PMG/API2/OIDC.pm @@ -46,6 +46,10 @@ my $lookup_oidc_auth = sub { $oidc_config->{acr_values} = [PVE::Tools::split_list($acr)]; } + if (defined(my $audiences = $config->{'audiences'})) { + $oidc_config->{audiences} = [PVE::Tools::split_list($audiences)]; + } + my $oidc = Proxmox::RS::OIDC->discover($oidc_config, $redirect_url); return ($config, $oidc); }; diff --git a/src/PMG/Auth/OIDC.pm b/src/PMG/Auth/OIDC.pm index be57afb..993466e 100755 --- a/src/PMG/Auth/OIDC.pm +++ b/src/PMG/Auth/OIDC.pm @@ -129,6 +129,14 @@ sub properties { pattern => qr/^[a-zA-Z0-9._:-]+$/, optional => 1, }, + 'audiences' => { + description => + "A list of audiences that the OpenID Issuer may include that are accepted in " + . "addition to 'client-id'.", + type => 'string', # format => 'some-safe-id-list', # FIXME: TODO + pattern => qr/^[a-zA-Z0-9._:-]+$/, + optional => 1, + }, }; } @@ -144,6 +152,7 @@ sub options { prompt => { optional => 1 }, scopes => { optional => 1 }, 'acr-values' => { optional => 1 }, + audiences => { optional => 1 }, default => { optional => 1 }, comment => { optional => 1 }, }; -- 2.47.3