Proxmox VE
Proxmox VE は OpenID Connect (OIDC) レームに対してユーザーを認証できます。Casdoor をレームとして使用することで、管理者は Casdoor アカウントで Proxmox VE Web インターフェースにサインインでき、Proxmox VE の権限は Casdoor グループに従います。
Casdoor でアプリケーションを作成する
-
Casdoor 管理コンソールで、ユーザーの組織を開き、アプリケーションを追加するか、既存のアプリケーションを開きます。
-
ポート番号を含め、Proxmox VE Web インターフェースのアドレスを Redirect URLs に追加します:
https://pve.example.com:8006Proxmox VE はブラウザが開いたアドレスをリダイレクト URL として送信するため、使用するすべてのアドレス(例えば各ノードのアドレス)を追加してください。
-
OIDC/OAuth タブで、Token group format を
Name (group)に設定します。これにより、グループはmy-org/pve-adminsではなくpve-adminsとして届くようになります。 -
保存し、Client ID と Client secret をメモします。
OpenID Connect レームを追加する
-
Proxmox VE ノード上で実行します:
pveum realm add casdoor --type openid \
--issuer-url https://door.example.com \
--client-id "<your-client-id>" \
--client-key "<your-client-secret>" \
--username-claim username \
--autocreate 1 \
--groups-claim groups \
--groups-autocreate 1Web インターフェースの Datacenter > Permissions > Realms > Add > OpenID Connect Server で同じ値を入力することもできます。
--issuer-url: Casdoor の URL です。末尾のスラッシュは含めません。--username-claim username:preferred_usernameクレームを読み取ります。これにより、ユーザーはalice@casdoorのように表示されます。デフォルトのsubjectは Casdoor ユーザー ID を使用します。--groups-claim groups,--groups-autocreate 1: ユーザーの Casdoor グループから Proxmox VE グループを作成します。これらのオプションがないバージョンでは、これらを省略し、代わりにユーザーに権限を付与してください。
-
グループにロールを付与します。Proxmox VE はクレームからのグループにレーム名を追加するため、
pve-adminsはpve-admins-casdoorになります:pveum acl modify / --groups pve-admins-casdoor --roles Administrator
結果を検証する
- Proxmox VE Web インターフェースを開き、casdoor レームを選択して、Login (OpenID redirect) をクリックします。
pve-adminsのメンバーとして Casdoor にサインインします。Proxmox VE は、alice@casdoorとしてサインインしたユーザーと管理者権限を表示して開かれます。
トラブルシューティング
| Symptom | Cause and fix |
|---|---|
Casdoor shows Redirect URI: ... doesn't exist in the allowed Redirect URI list | Add the exact address from the error, with the port, to Redirect URLs. |
| The user signs in but sees nothing | No permissions apply. Grant a role to the user's group or to the user with pveum acl modify. |
Sign-in fails with missing claim 'preferred_username' | The realm can't read the username. Keep Query userinfo endpoint on, and request the profile scope. |
関連項目
- Proxmox VE wiki の User management