"no authentication credentials provided" when using PBS API

guerro

Member
Oct 1, 2021
11
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:
  • Like
Reactions: daniel1820815