lollipopkit / flutter_server_box

ServerBox - server status & toolbox
GNU General Public License v3.0
4.84k stars 307 forks source link

PVE does not connect if OTP is enabled on the server #608

Open smtdev opened 1 month ago

smtdev commented 1 month ago

Describe the bug:

I have three Proxmox servers at home, and only one of them has OTP enabled. Two of them can use the "PVE" option without any issues since they log in with the same user and password as the SSH connection. However, the third one cannot connect because there is no way to configure the Proxmox instance to use OTP for the "Linux PAM standard authentication" realm. When I click on the "PVE" option, it returns the following error:

PVE list failed: DioException [bad response]: This exception was thrown because the response has a status code of 401 and RequestOptions.validateStatus was configured to throw for this status code. The status code of 401 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled" Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.

To Reproduce

  1. Set up a new Proxmox server with OTP enabled.
  2. Click on the specific server under the "Server" tab on the home screen.
  3. Scroll down to find the "PVE" option.
  4. Click on "PVE".
  5. The error will appear.

Desired Results

I expect the same result as with the other servers: a list of my LXC or VM instances along with basic management options.

Actual Results

The app returns a 401 error, and I cannot access the server information.

Screenshots

401 error

log

Device

Additional context

It seems the issue arises due to the lack of OTP support for the specific realm ("Linux PAM standard authentication").