corpusops / bitwardentools

bitwarden python api client and additional tools like for migrating from vaultier to bitwarden (bitwarden_rs)
Other
38 stars 15 forks source link

add TOTP support #11

Closed perkons closed 2 years ago

perkons commented 3 years ago

We would like to use bitwardentools with TOTP as we require all users to have 2FA with Google Authenticator, Authy or other. Would be nice to have the option to use the Authenticator Key in the client. Something like this: client = Client('https://bitwarden.example.com', 'user@example.com', 'user_password', 'authenticator_key');

kiorky commented 3 years ago

PR are welcome :o)

I wont have the time to do it myself right now .

mfominov commented 2 years ago

U won't need totp while using api_key/secret. In that case #14 is more valuable feature.

mfominov commented 2 years ago
BITWARDEN_TOKEN=$(curl --location -s --request POST \
  ${BITWARDEN_URL}/identity/connect/token \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "scope=api" \
  --data-urlencode 'deviceName=chrome' \
  --data-urlencode 'deviceIdentifier=DEVICE_ID' \
  --data-urlencode 'deviceType=DEVICE_TYPE' \
  --data-urlencode "username=${BITWARDEN_USER}" \
  --data-urlencode "client_id=${BITWARDEN_CLIENID}" \
  --data-urlencode "client_secret=${BITWARDEN_SECRET}" | jq -r '.access_token')
kiorky commented 2 years ago

dup #14