Corsinvest / cv4pve-pepper

Launching SPICE remote-viewer for Proxmox VE VDI client
https://www.corsinvest.it/cv4pve
GNU General Public License v3.0
105 stars 15 forks source link

how to connect with --api-token ? #20

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi, you have this example:

cv4pve-pepper --host=192.168.0.100 --username=root@pam --password=fagiano --vmid 100 --viewer path-spice-viewer

but i want to connect with --api-token

can you give example, how to use --api-token instead of --password ?

franklupo commented 2 years ago

Hi, cv4pve-pepper --host=192.168.0.100 --api-token USER@REALM!TOKENID=UUID

https://pve.proxmox.com/pve-docs/pveum-plain.html

franklupo commented 2 years ago

News?

ghost commented 2 years ago

hi, sorry, but i cannot connect with token, maybe i don't make user rights correctly. i will try today, and reply.

ghost commented 2 years ago

cv4pve-pepper --host=192.168.0.100 --api-token USER@REALM!TOKENID=UUID

when i create user, i can set PAM or PVE, where you get REALM?. which user i need to create to use token?

ghost commented 2 years ago

i able to run only in this mode:

./cv4pve-pepper --host=192.168.1.50 --username=root@pam --password=mypassword--vmid 105 --viewer /usr/bin/remote-viewer

in another cases i tried with token:

./cv4pve-pepper --host=192.168.1.50 --api-token 'user@pam!TOKENID=a992c-da60-4db8-925d' --vmid 105 --viewer /usr/bin/remote-viewer
Problem connection! no such token 'TOKENID' for user 'user@pam'
franklupo commented 2 years ago

cv4pve-pepper --host=192.168.0.100 --api-token USER@REALM!TOKENID=UUID

when i create user, i can set PAM or PVE, where you get REALM?. which user i need to create to use token?

REALM is pam or pve

franklupo commented 2 years ago

i able to run only in this mode:

./cv4pve-pepper --host=192.168.1.50 --username=root@pam --password=mypassword--vmid 105 --viewer /usr/bin/remote-viewer

in another cases i tried with token:

./cv4pve-pepper --host=192.168.1.50 --api-token 'user@pam!TOKENID=a992c-da60-4db8-925d' --vmid 105 --viewer /usr/bin/remote-viewer
Problem connection! no such token 'TOKENID' for user 'user@pam'

Remove the single quote ' or use double quote "

ghost commented 2 years ago

With and without quotes:


$ ./cv4pve-pepper --host=192.168.1.50 --username=user@pam --password=mypassword --api-tok
en="user@pam!tokenid=a992c-da60-4db8-925d" --vmid 105 --viewer /usr/bin/remote-viewer 
bash: !tokenid=a992c: event not found 

$ ./cv4pve-pepper --host=192.168.1.50 --username=user@pam --password=mypassword --api-tok
en=user@pam!tokenid=a992c-da60-4db8-925d --vmid 105 --viewer /usr/bin/remote-viewer 
bash: !tokenid=a992c: event not found 
franklupo commented 2 years ago

user@pam!tokenid=a992c-da60-4db8-925d change user with your user

ghost commented 2 years ago

i want to create a new user with limited rights, and give access only to VM! because i tried to use your software.

nate2014jatc commented 2 years ago

Hello, .\cv4pve-pepper.exe --api-token Viewer@PVE!e3093149-2efa-455d-ad74-aa54611d3a50 --host=192.168.1.7:8006 --vmid 119 --viewer 'C:\Program Files\VirtViewer v9.0-257\bin\remote-viewer.exe' is returning the error Problem connection! no tokenid specified

I have tried it as --api-token, --api-token=, --api-token='', and --api-token ''

What am I missing here?

((This token has been removed for safety reasons))

nate2014jatc commented 2 years ago

Hello,

it appears the correct syntax is .\cv4pve-pepper.exe --api-token 'Viewer@pve!{TOKEN_NAME}={TOKEN_SECRET}' --host=192.168.1.7:8006 --vmid 119 --viewer 'C:\Program Files\VirtViewer v9.0-257\bin\remote-viewer.exe'