Keeper-Security/keeper-sdk-dotnet

Using PowerCommander in Azure Function App

insertusername20 opened this issue · 3 comments

We are trying to use PowerCommander module for various automation tasks.
Testing in a Function App fails during logon with "connect-keeper -Username $user -Password $pass"

[Information] OUTPUT: Read-Host: C:\home\site\wwwroot\Modules\PowerCommander\AuthCommands.ps1:424
[Information] OUTPUT: Line |
[Information] OUTPUT: 424 | $action = Read-Host -Prompt $prompt
[Information] OUTPUT: | ~~~~~~~~~~~~~~~~~~~~~~~~~
[Information] OUTPUT: | A command that prompts the user failed because the host program or the command type does not support user interaction. The host was attempting to request confirmation with the following message:

Any advice?

Login to Keeper may interrupted by the backend to request:

  1. device approval
  2. two factor authentication
  3. password

In your case it is either 1 or 2
Once device approved or 2FA passed for the particular installation or device connect-keeper will go through.

Device configuration is stored into config.json file in your $HOME/.keeper (or %HOME%.keeper) folder.
You can create config.json file using desktop PowerShell make sure the login is not interrupted then transfer that configuration file to your Azure function home directory.

Login to Keeper may interrupted by the backend to request:

  1. device approval
  2. two factor authentication
  3. password

In your case it is either 1 or 2 Once device approved or 2FA passed for the particular installation or device connect-keeper will go through.

Device configuration is stored into config.json file in your $HOME/.keeper (or %HOME%.keeper) folder. You can create config.json file using desktop PowerShell make sure the login is not interrupted then transfer that configuration file to your Azure function home directory.

I'm pretty sure the account we are testing with has no 2FA or device approval needs.
It has only access to run PowerCommander.

We "commented out" the read-host lines and tested locally, again that works fine.
Running the same modified module in azure function removed the initial error, but prompts for password.
No script error, but waiting for user input.

Could it be some problems creating the config.json? Is it possible to change default path of this file?

It worked by copying the config.json.
Thanks a lot for your help!