Browse Source

docs: update example for bitwarden password manager (#4674)

Login with username and password prompts for a email verification code on a new device / container: https://bitwarden.com/help/new-device-verification/. This can be circumvented by using an apikey to log in.

Signed-off-by: Julian U <48368594+lunarys@users.noreply.github.com>
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Julian U 1 year ago
parent
commit
84304e7dae
1 changed files with 8 additions and 1 deletions
  1. 8 1
      docs/examples/bitwarden.md

+ 8 - 1
docs/examples/bitwarden.md

@@ -51,7 +51,14 @@ set -e
 
 bw config server ${BW_HOST}
 
-export BW_SESSION=$(bw login ${BW_USER} --passwordenv BW_PASSWORD --raw)
+if [ -n "$BW_CLIENTID" ] && [ -n "$BW_CLIENTSECRET" ]; then
+    echo "Using apikey to log in"
+    bw login --apikey --raw
+    export BW_SESSION=$(bw unlock --passwordenv BW_PASSWORD --raw)
+else
+    echo "Using username and password to log in"
+    export BW_SESSION=$(bw login ${BW_USER} --passwordenv BW_PASSWORD --raw)
+fi
 
 bw unlock --check