OnePassword.NET Nuget package and CLI v2

FerdieW
FerdieW
Community Member

I'm new to 1Password and trying to use the OnePassword.NET Nuget package with CLI v2 in a Visual Studio C# project.

My code is as follows:

using OnePassword;

try
{

                var onePassword = new OnePasswordManager();

                var domain = "my.1password.com";
                var email = "myemail@abc.com";
                var secretKey = "Key";
                var password = "Pwd";


                onePassword.AddAccount(domain, email, secretKey, password);
                onePassword.SignIn(password);* (GET ERROR HERE: No accounts configured for use with 1Password CLI -- )
            }
        }
        catch (Exception ex)
        {
            _logger.LogError(ex, ex.Message);
        }
  1. My question is how and where do I need to configure the account before I could use it with 1Password CLI.

1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Windows 10 Pro
Browser:_ Version 105.0.5195.127

Comments

  • FerdieW
    FerdieW
    Community Member

    I did come right eventually. Tx

  • The piece of code you presented should work as expected from what I can tell from the 1Password CLI .NET wrapped Github repo docs. The only configuring you need to do is to add your account as instructed. You could always try to configure the account directly in the CLI by running op account add.

    Let me know if you are still facing issues. Best,
    Andi

This discussion has been closed.