public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Michal Fox <me@dualfroz.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager 1/2] fix #7649: ui: active directory realm: expose user attribute name option
Date: Sun,  4 Oct 2026 16:03:34 +0000	[thread overview]
Message-ID: <20261004160335.6-2-me@dualfroz.com> (raw)
In-Reply-To: <20261004160335.6-1-me@dualfroz.com>

AD realms support the 'user_attr' option, which sets the attribute used
as username when syncing users, but it can only be set via the CLI. It
is needed for logging in with the user principal name, if that does not
end with the AD domain: with 'userPrincipalName' as attribute, the users
are synced with their full user principal name, which is then used as
is to bind to the server on login.

Add a field for it, like the LDAP realm has, with the 'sAMAccountName'
default as empty text.

Signed-off-by: Michal Fox <me@dualfroz.com>
---
Tested in the browser with the realm edit window and mocked API calls:
on create, the new field is only sent if set; on edit, a 'user_attr'
set via the CLI is shown, kept when saving, and deleted when the field
is cleared. Without the patch, there is no field, and the value can
only be changed via the CLI.

That the attribute is only used by the sync and the login binds with
the given name as is, if it contains an '@', is from reading
PVE::Auth::AD; the reporter confirmed that UPN logins work with it.

 www/manager6/dc/AuthEditAD.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/www/manager6/dc/AuthEditAD.js b/www/manager6/dc/AuthEditAD.js
index ec5e7808..530b1a67 100644
--- a/www/manager6/dc/AuthEditAD.js
+++ b/www/manager6/dc/AuthEditAD.js
@@ -17,6 +17,13 @@ Ext.define('PVE.panel.ADInputPanel', {
                 emptyText: 'company.net',
                 allowBlank: false,
             },
+            {
+                xtype: 'proxmoxtextfield',
+                name: 'user_attr',
+                fieldLabel: gettext('User Attribute Name'),
+                emptyText: Proxmox.Utils.defaultText + ' (sAMAccountName)',
+                deleteEmpty: !me.isCreate,
+            },
             {
                 xtype: 'proxmoxcheckbox',
                 fieldLabel: gettext('Case-Sensitive'),
-- 
2.43.0




  reply	other threads:[~2026-10-04 16:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04 16:03 [PATCH manager/docs 0/2] fix #7649: active directory realm: expose and document user attribute name Michal Fox
2026-10-04 16:03 ` Michal Fox [this message]
2026-10-04 16:03 ` [PATCH docs 2/2] pveum: active directory: document user attribute name option Michal Fox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261004160335.6-2-me@dualfroz.com \
    --to=me@dualfroz.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal