Credentials

Password Manager Vaults

WithService(LastPass / OnePassword / Dashlane / Bitwarden / Keeper) retrieves a saved login from that password manager. GetCredentialsFor sets the search target, WithDomain filters by URL, and SaveTo appends matching [Username, Password] rows to a grid.

WithService(LastPass / OnePassword / Dashlane / Bitwarden / Keeper) retrieves a saved login from that password manager. GetCredentialsFor sets the search target, WithDomain filters by URL, and SaveTo appends matching [Username, Password] rows to a grid.

LastPass, 1Password, Dashlane, and Keeper are accessed through their respective command-line tools (lpass, op, dcli, keeper), which must already be installed and logged in on the machine running GPAL. Bitwarden is accessed directly via its public vault REST API using WithServiceKey (a "ClientId:ClientSecret" pair) plus the master account's WithUsername/WithPassword - no CLI is required. For every service, GetCredentialsFor(target) searches the vault by item name, URL, or username, and WithDomain(domain) further restricts results to items whose stored URL contains that domain. SaveTo(grid) appends one [Username, Password] row per matching item.

TIP

For LastPass, 1Password, Dashlane, and Keeper, GPAL checks the CLI's session status before searching. If the tool is not installed or not logged in, GPAL publishes an ERROR event containing the exact command to run (e.g. "lpass login you@example.com" or "op signin") and SaveTo returns no rows.

WARNING

Unlike the other vaults, Bitwarden authenticates via the OAuth resource-owner-password flow against the public vault REST API. WithServiceKey, WithUsername, and WithPassword (your Bitwarden API key and master account credentials) must all be set before calling GetCredentialsFor.

Examples

GPAL Fluent: High-level fluent C# API

//Each ServiceType uses the credentials and search target appropriate to that vault, but the result is always the same: SaveTo appends [Username, Password] rows to the grid for items matching GetCredentialsFor's target and (if set) WithDomain's filter.

// LastPass - requires `lpass login you@example.com` once on the machine var lpGrid = GPAL.Grid.ToGPALObject(); GPAL.CredentialsFor(CredentialServiceType.LastPass) .WithUsername("you@example.com") .GetCredentialsFor("example.com") .WithDomain("example.com") .SaveTo(lpGrid); // 1Password - requires `op signin` once on the machine var opGrid = GPAL.Grid.ToGPALObject(); GPAL.CredentialsFor(CredentialServiceType.OnePassword) .GetCredentialsFor("My Bank Login") .SaveTo(opGrid); // Bitwarden - public vault REST API, no CLI required var bwGrid = GPAL.Grid.ToGPALObject(); GPAL.CredentialsFor(CredentialServiceType.Bitwarden) .WithServiceKey("client-id:client-secret") .WithUsername("you@example.com") .WithPassword("master-password") .GetCredentialsFor("example.com") .WithDomain("example.com") .SaveTo(bwGrid);