From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 17D3E1FF136 for ; Mon, 20 Apr 2026 17:34:08 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8A4DD7169; Mon, 20 Apr 2026 17:34:07 +0200 (CEST) From: Shannon Sterz To: pve-devel@lists.proxmox.com Subject: [PATCH access-control v4 2/3] fix #5076: auth: open id: add an optional "audiences" field Date: Mon, 20 Apr 2026 17:33:31 +0200 Message-ID: <20260420153332.414620-3-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260420153332.414620-1-s.sterz@proxmox.com> References: <20260420153332.414620-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: 1776699129317 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.123 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: BVN5RNAIM5TYHQHZWQUKB6BVPQG2S4P5 X-Message-ID-Hash: BVN5RNAIM5TYHQHZWQUKB6BVPQG2S4P5 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 VE 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. Originally-by: Alexander Abraham [SS: * rephrased the commit message for style and clarity * adjusted the parameter description to be clearer * removed a validation pattern that was incorrect and set a maxLength for members of the "audiences" array * removed changes that only reformatted unrelated code ] Signed-off-by: Shannon Sterz --- src/PVE/API2/OpenId.pm | 4 ++++ src/PVE/Auth/OpenId.pm | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/PVE/API2/OpenId.pm b/src/PVE/API2/OpenId.pm index cccd615..58ffd81 100644 --- a/src/PVE/API2/OpenId.pm +++ b/src/PVE/API2/OpenId.pm @@ -46,6 +46,10 @@ my $lookup_openid_auth = sub { $openid_config->{acr_values} = [PVE::Tools::split_list($acr)]; } + if (defined(my $audiences = $config->{'audiences'})) { + $openid_config->{audiences} = $config->{'audiences'}; + } + my $openid = PVE::RS::OpenId->discover($openid_config, $redirect_url); return ($config, $openid); }; diff --git a/src/PVE/Auth/OpenId.pm b/src/PVE/Auth/OpenId.pm index 2209040..2467263 100755 --- a/src/PVE/Auth/OpenId.pm +++ b/src/PVE/Auth/OpenId.pm @@ -92,6 +92,17 @@ sub properties { default => 1, optional => 1, }, + 'audiences' => { + description => + "A list of audiences that the OpenID Issuer may include that are accepted in " + . "addition to 'client-id'.", + type => 'array', + 'items' => { + type => 'string', + optional => 1, + maxLength => 256, + }, + }, }; } @@ -108,6 +119,7 @@ sub options { prompt => { optional => 1 }, scopes => { optional => 1 }, "acr-values" => { optional => 1 }, + audiences => { optional => 1 }, default => { optional => 1 }, comment => { optional => 1 }, "query-userinfo" => { optional => 1 }, -- 2.47.3