"no authentication credentials provided" when using PBS API

guerro

Member
Oct 1, 2021
10
0
6
22
Hello Everyone,
I'm trying to authenticate in proxmox backup server API using Postman.
I've already created a new user (with Admin access to / path) and then a new API Token (also with Admin access to / path).

Now, when i try to GET https://pbs.example.tld:8007/api2/json/access this endpoint i get the following error:
authentication failed - no authentication credentials provided.
1681713864643.png
for the authentication method i'm using the following:
1681713929101.png
(this works with my proxmox VE API).

Am I missing something here?
Any help is really appreciated.
 
Hi, the token has to be prefixed with a PBSAPIToken=, not PVEAPIToken, see https://pbs.proxmox.com/docs/user-management.html#api-tokens
Hi Chirs,
Thank you for the fast response.

We've already tried using PBSAPIToken=, the result is still the same
401 Unauthorized - authentication failed - no authentication credentials provided.
Maybe is something to do with how I configured the user access?
1681715935326.png
Thank you very much.
 
Also make sure to use the Authorization header, without any Bearer prefix.
 
I had errors with this too.

My error had been, that the Authorization-Data was not correct:

  • I also used PVEAPIToken instead of PBSAPIToken
  • I used = instead of : as the separator between TOKENNAME and TOKENSECRET

So I recommend to carefully check the Authorization token on such error message.

This command does work here:

Code:
curl -k -H 'Authorization: PBSAPIToken=USERNAME@pam!TOKENNAME:TOKENSECRET' \
     https://server.domain.tld:8007/api2/json/admin/datastore/DATASTORENAME

P. S. : I asked ChatGPT for an example for an API access. So I got the wrong syntax.
 
Last edited:

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!