project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

Bug: Unable to use Proxmox API Tokens for Cluster Connection (401 Unauthorized)

Open LarsGdk opened this issue 10 months ago • 2 comments

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

LarsGdk avatar Jan 26 '26 08:01 LarsGdk

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

Regards, Marcus

mkellermann97 avatar Jan 26 '26 15:01 mkellermann97

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

mkellermann97 avatar Jan 28 '26 18:01 mkellermann97