[SOLVED] PBS API keeps returning "authentication failed - invalid token name"

Aug 17, 2024
3
0
1
Hi All,
I am using the PVE api without any issue so i am familiar with the basics of creating an API token and using it via tools such as cURL or other command line and scripting methods.

However, when I attempt to replicate how I do this with PVE in order to do it with PBS (Backup Server 3.3.0), I cannot get the proxmox api to allow me to authenticate. No matter what I do, the PBS api always returns HTTP 401

> authentication failed - invalid token name

I am attempting to authenticate using the `Authorization` header, for example:

```
Authorization: PBSAPIToken=apiuser@pbs!apitoken=00000000-0000-0000-0000-000000000000
```

I have tried to use my normal `root@pam` user and have also tried to create a separate local PBS user (e.g. `api@pbs`). I've tried searching around the web (as best i could with google being so degraded) and didn't really find anything that was helpful.

Is this a known bug/issue or am I missing something?
 
ok this is really dumb, but figured out that the problem is that PVE and PBS do not adhere to the same format:

PVE

PVEAPIToken=root@pam!apitoken=00000000-0000-0000-0000-000000000000

PBS

PBSAPIToken=root@pam!apitoken:00000000-0000-0000-0000-000000000000

Notice that PVE requires

Code:
<token_name>=<token_value>

While PBS requires

Code:
<token_name>:<token_value>

one is equal sign and the other a colon.
 
Last edited:
A little trap, indeed :)

I think you can mark this thread as solved by adding the “Solved” prefix via the “Edit Thread” menu above. To help others find the solution. Thanks!
 
  • Like
Reactions: drewmiraneda