Hi,
i started today to integrate Proxmox in our web php application and everything works great except noVNC.
I'm using this api wrapper: https://github.com/Saleh7/ProxmoxVE_PHP_API
Additionally i oriented myself and used some code from: https://github.com/CpuID/pve2-api-php-client
My Problem is that i always get the no ticket error, but the PVEAuthCookie is set.
I already tried to research the problem and found some posts about it but nothing of the solutions work.
See the relevant code snippets attached:
And as I said, everything works fine, i get all results from the api. I also tried to login with the account on the proxmox webinterface and copied the value of the cookie from there and pasted it on my website, but still the same error. I'm also using the same domain (just different subdomain for proxmox host and website).
Oh and i just saw that i also get an error in the proxmox webinterface:
(The test user should have all permissions. PVEVMUser)
Maybe somebody here got an idea and can help me out here?
Excited to here from you!
i started today to integrate Proxmox in our web php application and everything works great except noVNC.
I'm using this api wrapper: https://github.com/Saleh7/ProxmoxVE_PHP_API
Additionally i oriented myself and used some code from: https://github.com/CpuID/pve2-api-php-client
My Problem is that i always get the no ticket error, but the PVEAuthCookie is set.
I already tried to research the problem and found some posts about it but nothing of the solutions work.
See the relevant code snippets attached:
PHP:
$vnc = new ProxmoxVNC(); # login(), check_login_ticket(), setCookie() from pve2_api.class.php
if ($vnc->login())
$vnc->setCookie();
new Proxmox; # initializes my proxmox object, constructor calls Request::Login($credentials);
$nodes = new Nodes;
$proxy = $nodes->createQemuVncproxy('alpha', 106); # alpha is the name of my host, 106 the vm id
$nodes->qemuVncwebsocket('alpha', 106, $proxy->data->port, $proxy->data->ticket);
$vnc_iframe = $vnc->getFrame(106, $proxy->data->port, $proxy->data->ticket);
PHP:
public function getFrame($vmid, $port, $ticket)
{
#both variants fail with the same mentioned error:
#return "<iframe style='width: 900px; height: 900px;' src='https://{$this->hostname}:8006/?console=kvm&novnc=1&node=alpha&resize=scale&vmid={$vmid}&path=api2/json/nodes/alpha/qemu/{$vmid}/vncwebsocket?port={$port}&vncticket={$ticket}'></iframe>";
#return "<iframe style='width: 900px; height: 900px;' src='https://{$this->hostname}:{$this->port}/?console=kvm&novnc=1&vmid={$vmid}&node=alpha&resize=off&cmd=' frameborder='0' scrolling='no'></iframe>";
}
And as I said, everything works fine, i get all results from the api. I also tried to login with the account on the proxmox webinterface and copied the value of the cookie from there and pasted it on my website, but still the same error. I'm also using the same domain (just different subdomain for proxmox host and website).
Oh and i just saw that i also get an error in the proxmox webinterface:
(The test user should have all permissions. PVEVMUser)
Maybe somebody here got an idea and can help me out here?
Excited to here from you!
Last edited: