https://auth.example.com 请换成你的 Casdoor 地址(Casdoor 云上类似 https://acme.casdoor.com),其他 example.com 地址也换成你自己的。用 Casdoor 配置 Proxmox VE
- 1
在 Casdoor 中注册 Proxmox VE
在 Casdoor 控制台打开 应用,为 Proxmox VE 添加一个应用,在它的 OIDC/OAuth 标签页复制 客户端ID 和 客户端密钥。把下面的地址加到 重定向URLs:
https://pve.example.com:8006
Proxmox VE sends the address of its web interface as the redirect URL, so add every address you open it at, with the port. 要用群组的话,先在应用所属的组织里创建群组(例如
pve-admins)并加入用户,再在同一个标签页把 Token 中的群组格式 设成 Name,这样令牌里是pve-admins,而不是<组织>/pve-admins。 - 2
Add an OpenID Connect realm
Run this on a Proxmox VE node, or add the realm under Datacenter → Permissions → Realms → Add → OpenID Connect Server.
usernametakes thepreferred_usernameclaim, so users appear asalice@casdoor.pveum realm add casdoor --type openid \ --issuer-url https://auth.example.com \ --client-id "<client ID>" \ --client-key "<client secret>" \ --username-claim username \ --autocreate 1 \ --groups-claim groups \ --groups-autocreate 1 - 3
Give the group permissions
Proxmox VE appends the realm name to groups from the claim, so
pve-adminsbecomespve-admins-casdoor. Grant it a role, for example administrator rights on the whole datacenter:pveum acl modify / --groups pve-admins-casdoor --roles Administrator - 4
Sign in
On the Proxmox VE login screen, choose the casdoor realm and click Login (OpenID redirect); Proxmox sends you to Casdoor and back.
注意事项
- Users created by
--autocreatehave no permissions until a group or user ACL grants them some. - The group options are in recent Proxmox VE releases; on older versions, leave out the
--groups-*lines and grant permissions to users instead.
Proxmox VE 的设置取自它的官方文档(核对于 2026年10月:Proxmox VE user management、pveum manual);另见Casdoor 文档。Proxmox VE 是其所有者的商标。
常见问题
Can I still use root@pam?
Yes. Adding a realm doesn't change the existing PAM and Proxmox VE realms, so keep root@pam as a fallback.
Why username and not the default subject claim?
The default sub claim is Casdoor's user ID, a random string. username gives readable names such as alice@casdoor; Casdoor usernames are unique within an organization.
更多应用集成
查看全部Argo CD
应用集成Connect Argo CD to Casdoor over OpenID Connect: oidc.config in argocd-cm, the client secret, PKCE, CLI login and RBAC from Casdoor groups.
Gitea
应用集成Add Casdoor to Gitea as an OpenID Connect authentication source: the add-oauth command, callback URL, and admins from a Casdoor group.
GitLab
应用集成Configure self-managed GitLab to sign users in with Casdoor over OpenID Connect: gitlab.rb provider settings, account creation and group-based admins.
