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 571901FF13F for ; Thu, 07 May 2026 13:11:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 87BC81448F; Thu, 7 May 2026 13:11:13 +0200 (CEST) From: Shannon Sterz To: pve-devel@lists.proxmox.com Subject: [PATCH pmg-api v5] fix #5076: auth: openid: add support for an optional "audiences" field Date: Thu, 7 May 2026 13:10:57 +0200 Message-ID: <20260507111058.146433-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260423133548.349086-1-s.sterz@proxmox.com> References: <20260423133548.349086-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: 1778152157320 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.118 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: HU4BS5TGPRJWI5S64URGVBD32DM6GXA3 X-Message-ID-Hash: HU4BS5TGPRJWI5S64URGVBD32DM6GXA3 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. 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..8cbfc98 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'})) { + $openid_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