noVNC connect to Proxmox failed: HTTP authentication failed; no valid credentials available

hntloveit

New Member
Sep 14, 2020
1
0
1
35
Hello,
Im use noVNC lib, and Im trying connect to Proxmox then have error: HTTP authentication failed; no valid credentials available
Please check help me!

1600062935965.png
 
Having about the same problem here. I get a session from the endpoint:
PHP:
'/nodes/' . $master->node . '/qemu/' . $server->vmid . '/vncproxy'
Afterwards I open the websocket hitting the following endpoint:
PHP:
'/nodes/' . $master->node . '/qemu/' . $server->vmid . '/vncwebsocket'
Seems to work like a charm. I get a ticket and the socket is supposedly opened. I then try to connect to the websocket as follows:
Code:
wss://[PROXMOX_URL]:8006/api2/json/nodes/[NODE]/qemu/[VMID]/vncwebsocket?port=5902&vncticket=[URLENCODED_VNC_TICKET]
Now that ends up in the same "HTTP authentication failed" message as @hntloveit showed above. I'm using an external noVNC HTML5 client with the following URL parameters (settings) set:
Code:
vnc.html?autoconnect=1&reconnect=1&logging=debug&host=[PVE_HOST]&password=[URLENCODED_VNC_TICKET]&path=api2%2Fjson%2Fnodes%2F[PVE_NODE]%2Fqemu%2F61338%2Fvncwebsocket%3Fport%3D5901%26vncticket%3D[URLENCODED_VNC_TICKET]
FYI: I see a console session popping up in the Proxmox log, although I can't connect to the websocket. I suppose something's wrong with the parameters provided to noVNC.

I had to set some placeholders to preserve privacy. If anything critical is missing just ask.

Can anyone help solving this?

Thanks in advance!
 
Last edited:
the connection to the websocket has to carry the proxmox auth ticket as a cookie
 
  • Like
Reactions: AniiXx
Sorry for the late reply but thanks for mentioning @dcsapak. I injected the cookie into the websocket connection and now everything works just fine. It seems like I forgot to set the CORS attributes for the PVEAuthCookie so it wasn't set correctly and therefor not passed to the websocket. Please excuse my own dumbness in this matter.

Kind regards
 
Sorry for the late reply but thanks for mentioning @dcsapak. I injected the cookie into the websocket connection and now everything works just fine. It seems like I forgot to set the CORS attributes for the PVEAuthCookie so it wasn't set correctly and therefor not passed to the websocket. Please excuse my own dumbness in this matter.

Kind regards
i want to know how to set the CORS attributes for the PVEAuthCookie ,thanks
 

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!