PBS API connectivity

LodgedDrip

New Member
Feb 26, 2021
21
2
3
Hi,

I've set up a python script that is going to be using the PBS API, however, when trying to connect I'm seeing the following:
"2023-01-17T13:48:53+00:00: authentication failure; rhost=[REMOVED] msg=user account or token disabled or expired."

For testing purposes, it's using the "root@pam" user like such in the auth header "PBSAPIToken=root@pam!scripts" and then the secret value.

I've set up "API Token Permissions" to the / path, hooked to the API token and with the 'admin' role.

Nothing should be disabled or expired since I'm using this account daily and the token is set to never expire.
 
did you adhere to the format of "PBSAPIToken=root@pam!token:SECRET" (note the colon ':')
 
Hi all !

I am trying to connect to PBS 2.3.2 API using PHP, Curl and Postman but the script always receives the same error message:

authentication failed - no authentication credentials provided.

I have tried from command line using Curl, also scripting with PHP and even Postman with both methods (providing user and password in a call to /api2/json/access/ticket) and also providing API key, but nothing works.... Both the user and the API key have been authorized (user permissions and api key permissions).... Can you please share a piece of code in Python (or any programming language) with the authentication process?

Best regards,

Antonio Navarro Navarro
 
in curl:
Bash:
TOKEN='root@pam!curl'
KEY='897eaf39-3913-4a18-882a-e80b2de0a29a'
curl -k -H "Authorization: PBSAPIToken=$TOKEN:$KEY" https://localhost:8007/api2/json

Please note the colon ':' between token and key, and the name of the token 'PBSAPIToken' - you're probably using PVEAPIToken
 
  • Like
Reactions: flames

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!