Open jacobdotcosta opened 2 years ago
I did a test but when I re-open the terminal, bw is still asking me about the master password. Can we skip that ? @jacobdotcosta
Scenario
bw login --apikey
? client_id: user.xxxxxxxxxxxx
? client_secret: tttttttttt
You are logged in!
To unlock your vault, use the `unlock` command. ex:
$ bw unlock
~ bw unlock
? Master password: [hidden]
Your vault is now unlocked!
...
Restarted the terminal
bw list items
? Master password: [input is hidden]
Is the solution what I suggest hereafter ?
BW_USER=cmoulliard
bw logout
export BW_CLIENTID=$(pass redhat/bitwarden/${BW_USER}/client_id | awk 'NR==1{print $1}')
export BW_CLIENTSECRET=$(pass redhat/bitwarden/${BW_USER}/client_secret | awk 'NR==1{print $1}')
bw login ${BW_USER}@redhat.com --apikey
export BW_PASSWORD=$(PASSWORD_STORE_DIR=~/.password-store-work pass show redhat/bitwarden/${BW_USER}/pwd | awk 'NR==1{print $1}')
export BW_SESSION=$(bw unlock --passwordenv BW_PASSWORD --raw)
bw list items | jq .
The bitwarden client command to create or insert a key/value in a store is more verbose than password store and requires to use a json object - https://bitwarden.com/help/cli/#create ? Can we simplify this process ? @jacobdotcosta
Remark: To be honest, I don't really see the advantage to use bitwarden as it is far verbose to be used vs password store.
Example to create a user/pwd for an item of type login
bw get template item | jq ".name=\"My Login Item\" | .login=$(bw get template item.login | jq '.username="jdoe" | .password="myp@ssword123"')" | bw encode | bw create item
WDYT? @iocanel @metacosm @aureamunoz @BarDweller @Sgitario @geoand @jacobdotcosta
I don't have much experience with either, but that does look like the case
Passwordstore vs Bitwaren
Installation
Download bitwarden CLI
Unzip the file.
Add execution permission
Usage
Login
Manual login
Batch login
Export 2 environment variables with the
client id
and theclient secret
.Login
Usage