[GH-ISSUE #9] Bug: Unable to use Proxmox API Tokens for Cluster Connection (401 Unauthorized) #6

Closed
opened 2026-03-02 15:47:07 +03:00 by kerem · 2 comments
Owner

Originally created by @LarsGdk on GitHub (Jan 26, 2026).
Original GitHub issue: https://github.com/PegaProx/project-pegaprox/issues/9

When attempting to add a Proxmox cluster using an API Token (format: user@pam!tokenid), the connection fails with a 401 Unauthorized error.

Technical Analysis: The current code in pegaprox_multi_cluster.py appears to hardcode the login process to the /api2/json/access/ticket endpoint, which only supports standard password authentication.
Python

Current problematic code snippet:

login_url = f"https://{host}:8006/api2/json/access/ticket"
resp = session.post(login_url, data=login_data, timeout=10)

Expected Behavior: The system should detect if an API Token is being used and instead send the token in the Authorization header (e.g., Authorization: PVEAPIToken=user@pam!tokenid=secret) rather than attempting a POST to the ticket endpoint.

Environment:

PegaProx Version: 0.6.1

Proxmox Version: 9.1.4
Originally created by @LarsGdk on GitHub (Jan 26, 2026). Original GitHub issue: https://github.com/PegaProx/project-pegaprox/issues/9 When attempting to add a Proxmox cluster using an API Token (format: user@pam!tokenid), the connection fails with a 401 Unauthorized error. Technical Analysis: The current code in pegaprox_multi_cluster.py appears to hardcode the login process to the /api2/json/access/ticket endpoint, which only supports standard password authentication. Python # Current problematic code snippet: login_url = f"https://{host}:8006/api2/json/access/ticket" resp = session.post(login_url, data=login_data, timeout=10) Expected Behavior: The system should detect if an API Token is being used and instead send the token in the Authorization header (e.g., Authorization: PVEAPIToken=user@pam!tokenid=secret) rather than attempting a POST to the ticket endpoint. Environment: PegaProx Version: 0.6.1 Proxmox Version: 9.1.4
kerem 2026-03-02 15:47:07 +03:00
Author
Owner

@mkellermann97 commented on GitHub (Jan 26, 2026):

Hi @LarsGdk ,
A fix has been implemented and will be included in version 0.6.2.

Regards,
Marcus

<!-- gh-comment-id:3800249284 --> @mkellermann97 commented on GitHub (Jan 26, 2026): Hi @LarsGdk , A fix has been implemented and will be included in version 0.6.2. Regards, Marcus
Author
Owner

@mkellermann97 commented on GitHub (Jan 28, 2026):

Hi @LarsGdk LarsGdk,
Could you please update your PegaProx version?
Regards,
Marcus

<!-- gh-comment-id:3813109283 --> @mkellermann97 commented on GitHub (Jan 28, 2026): Hi @LarsGdk LarsGdk, Could you please update your PegaProx version? Regards, Marcus
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/project-pegaprox-PegaProx#6
No description provided.