freenas-proxmox: Enabling 2FA on TrueNAS Scale causes 401 errors for `freenas_api_connect` Basic Auth

I am on TrueNAS-SCALE-22.12.3.3 and pve-manager/7.4-16/0f39f621 (running kernel: 5.15.104-1-pve)

It’s mentioned that SSH is used to run zfs commands to TrueNAS, but 2FA seems cause a 401 error to the plugin.

Sep 24 20:42:19 proxmox2 pvedaemon[488042]: [ERROR]FreeNAS::API::PVE::Storage::LunCmd::FreeNAS::freenas_api_connect : Response code: 401
Sep 24 20:42:19 proxmox2 pvedaemon[488042]: [ERROR]FreeNAS::API::PVE::Storage::LunCmd::FreeNAS::freenas_api_connect : Response content: HTTP Basic Auth is unavailable when OTP is enabled

There is an option to enable 2FA over SSH, but this is disabled by default.

image

I’m not entirely sure how the freenas_api_connect function handles this, but it seems API calls now require 2FA codes when its enabled? I had this working with 2FA on Core. Seems like something has changed on the TrueNAS side requiring it.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Yes. I have a version that using the Bearer Token. Will be pushing to the ‘truenas-proxmox-testing’ repo in a day or so. Also just making a few changes to some variables so seeing if the code updates the underlying config correctly.

I might have some time to submit a PR during the holidays.