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

hntloveit

New Member
Sep 14, 2020
1
0
1
37
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
 
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
How did you injected Cookie in websocket request., That issue is due to Cookies or CORS policy?
I am facing same problem., Can anyone help me here