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 18B031FF15F for ; Mon, 16 Dec 2024 05:15:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 318213DB8; Mon, 16 Dec 2024 05:15:42 +0100 (CET) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734322533; x=1734927333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tkkynRWsjv55sSyU9MfbCFj5yFP9Tx5EGZeBDNeS/v8=; b=SXwEgEcHBt2STSsvCPNuG5goww/oAUoJEXrSySWg5ccBrfZB3qt+dHzcZ/9p+EFD5T blZ2gxY1l2X9b4bjHfju8kr0jYj7DHFapAfjnBxXuO7V7itCPluaiA1DSvJWXvqYjPX5 bFTIOciketFnG6mrIuHQDVwpk2XcWydm3btneUy5e4vQPFSEai2NXPq8T3lzHUdwY+wy zaxLFUuUpgTdvWLzJ8m0vSAQjm63m22rqiVfxtX+0AZaTIzKEtoy0j43LAm23wc1hqOF 4eAr9E+xo1dtJBqvG94SbNv5cXVOESTt66egI2CaII1EvtTB61pB12AshGdR5ndRpy26 2jxQ== X-Gm-Message-State: AOJu0Yyz7H9iAAcS8HZiEVDDAJvBcDWd6+X4jdKw4ywJX+7oxB+ElRmr 9fmvyC2oLC0AGx1YoHdV6s7zsz2X40lAe5cmUwKUsXHjF4jXKQtzJfOYUg== X-Gm-Gg: ASbGncsRfblefPKqvlFlD6JDuSScfb143v9Ax3UzQpPZ13axqMtlAot/HlEPKa8ws4i wjK1bD0UBK+2qyIJNxjcaXXYbrgI+1loA1QuVR7j26LGC6cm4I4XOjNIQmGHOkUNb2JijKo/U+i lDlSvxp2SFTyIyY1azrYG+3g8T/vpspSQ+nA81lM+QuRxTlJtI0Mtk6F85RHy//ctmQ3V8HrLIJ bKY+fmXXb4MzRLzOo0W2raKv+W66CRhta6QL0RdgKDwHDQDN3zBIJpIL4WjmIFFO+fATRqvqKax Q1vXDy5jt6g1EL/RY/Ey+ylmA/uviqjgMZg4PL3JZCo0i/u5RRKGKAyfuDsBEoorJBp74g== X-Google-Smtp-Source: AGHT+IE927sON+wbMvGi90RKrMZKyF64lytMGhINYXSJMPsmRiXlqQzv84ebj2BrgJO9npTaV+d9qQ== X-Received: by 2002:a05:6902:2313:b0:e39:3168:1c30 with SMTP id 3f1490d57ef6-e434c426c4dmr8203372276.28.1734322532783; Sun, 15 Dec 2024 20:15:32 -0800 (PST) From: Thomas Skinner To: pve-devel@lists.proxmox.com Date: Sun, 15 Dec 2024 22:14:24 -0600 Message-Id: <20241216041428.1184350-2-thomas@atskinner.net> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241216041428.1184350-1-thomas@atskinner.net> References: <20241216041428.1184350-1-thomas@atskinner.net> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.554 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 FREEMAIL_FORGED_FROMDOMAIN 0.001 2nd level domains in From and EnvelopeFrom freemail headers are different FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider HEADER_FROM_DIFFERENT_DOMAINS 0.248 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust RCVD_IN_MSPIKE_H2 -1.13 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH access-control v2 1/5] fix #4234: add library functions for openid optional userinfo request X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Thomas Skinner Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Thomas Skinner --- src/PVE/API2/OpenId.pm | 6 +++++- src/PVE/Auth/OpenId.pm | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/OpenId.pm b/src/PVE/API2/OpenId.pm index 77410e6..ea1de16 100644 --- a/src/PVE/API2/OpenId.pm +++ b/src/PVE/API2/OpenId.pm @@ -170,7 +170,11 @@ __PACKAGE__->register_method ({ my ($config, $openid) = $lookup_openid_auth->($realm, $redirect_url); - my $info = $openid->verify_authorization_code($param->{code}, $private_auth_state); + my $info = $openid->verify_authorization_code_userinfo( + $param->{code}, + $private_auth_state, + $config->{'disable-userinfo'} // 0, + ); my $subject = $info->{'sub'}; my $unique_name; diff --git a/src/PVE/Auth/OpenId.pm b/src/PVE/Auth/OpenId.pm index c8e4db9..6efa696 100755 --- a/src/PVE/Auth/OpenId.pm +++ b/src/PVE/Auth/OpenId.pm @@ -63,6 +63,12 @@ sub properties { pattern => '^[^\x00-\x1F\x7F <>#"]*$', # Prohibit characters not allowed in URI RFC 2396. optional => 1, }, + "disable-userinfo" => { + description => "Prevents querying the userinfo endpoint for claims values.", + type => 'boolean', + default => 0, + optional => 1, + }, }; } @@ -78,6 +84,7 @@ sub options { "acr-values" => { optional => 1 }, default => { optional => 1 }, comment => { optional => 1 }, + "disable-userinfo" => { optional => 1 }, }; } -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel