CpuID / pve2-api-php-client

Proxmox 2.0 API Client for PHP
MIT License
93 stars 62 forks source link

Login to Proxmox Host failed. #32

Closed jesperschreuder closed 10 months ago

jesperschreuder commented 6 years ago

I'm 100% sure all the details are correct but i keep getting Login to Proxmox Host failed.

danhunsaker commented 6 years ago

What version of PVE are you running?

jesperschreuder commented 6 years ago

Proxmox Virtual Environment 5.1-41?

danhunsaker commented 6 years ago

Ok, I'll investigate that. This library was written around PVE 3, so some things may have changed a bit since then, and we may need to adjust the code accordingly.

emresaracoglu commented 4 years ago

Virtual Environment 5.4-13 The connection does not occur.

spamhome commented 3 years ago

https://github.com/CpuID/pve2-api-php-client/pull/36

lucapiccio commented 1 year ago

Hi, i'm debugging with Proxmox VE 7.2

after an analysis, i've found the problem is simply that setrawcookie("PVEAuthCookie", $this->login_ticket['ticket'], 0, "/"); is setting cookie for the actual domain, not for the public url of the PVE

You can try with somthing similar : setrawcookie("PVEAuthCookie", $this->login_ticket['ticket'], 0, "/", $this->hostname,true,false);

but the problem is that the browsers doesn't allow to set cookie for other domains.

I've solved this and i'm writing a patched version but this is "almost" the solution but i dont like that the cookie allow also to login to 8006 interface. I think is better to connect a Vnc client to the PVE vncproxy

lsthompson commented 10 months ago

Closing off this 5-6 y.o. discussion now. Improved error logging is in the works in Pull #42 - feel free to contribute.

re: @lucapiccio comments about anti-CSRF protections etc, yes, and in PVE v8.0 onwards this is mandatory now.

Set strict SameSite attribute on the Authorization cookie (ref)