Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"rbw login: failed to log in to bitwarden instance: Username or password is incorrect. Try again." #145

Closed
WxNzEMof opened this issue Nov 21, 2023 · 25 comments · Fixed by #151

Comments

@WxNzEMof
Copy link

Today I noticed that I can no longer log in with rbw. It does not accept my password.

I noticed that others have reported this problem in #32 and #88, though originally those issues were filed for different problems, so I'm creating an issue for this specific problem. Hope this helps.

@rjp
Copy link

rjp commented Nov 22, 2023

Also getting this. Been digging in to see if I can figure out if things are going wrong in rbw but nothing useful yet.

WxNzEMof added a commit to WxNzEMof/rbw that referenced this issue Nov 23, 2023
I believe this warning is very warranted, taking into account doy#145. Don't make the same mistake I did...
@carlosala
Copy link

Same here!

@augustebaum
Copy link

Same also; this seemed to coincide with my swapping i3 for GNOME, but this issue tells me there is something deeper happening.

@JeffDess
Copy link

@augustebaum I don't think it's related to a DE/WM, I'm having the same in Plasma connecting to the default API. Maybe BW changed something recently?

@valentingregoire
Copy link

I have this issue with a fresh installation. I can login on both the Chrome extension and the fedora app, yet not with the cli. The only thin I set is the email: rbw config set email my@email.com because the rest should be the default. When entering my password, the login fails... Could this be a certificate issue? I didn't configure a certificate in the app neither, but maybe that is using the chrome certs?

@carlosala
Copy link

Was someone able to debug it? I really need rbw in my daily workflow🥲

@joelsleeba
Copy link

joelsleeba commented Dec 5, 2023

❯ rbw config show
{
  "email": "******@****.com",
  "base_url": "https://api.bitwarden.com/",
  "identity_url": null,
  "notifications_url": null,
  "lock_timeout": 3600,
  "sync_interval": 3600,
  "pinentry": "pinentry-gnome3",
  "client_cert_path": null
}

❯ cat .local/share/rbw/agent.err
websocket error: Io(Kind(UnexpectedEof))
websocket error: Protocol(ResetWithoutClosingHandshake)
websocket error: Protocol(ResetWithoutClosingHandshake)
websocket error: Protocol(ResetWithoutClosingHandshake)
websocket error: Protocol(ResetWithoutClosingHandshake)
websocket error: Protocol(ResetWithoutClosingHandshake)
failed to sync: failed to load db from /home/user/.cache/rbw/https%3A%2F%2Fapi.bitwarden.com%2F:******@****.com.json: No such file or directory (os error 2)

I got the same issue. I tried with default base_url and pinentry. Same error

❯ rbw login
rbw login: failed to log in to bitwarden instance: failed to parse JSON: EOF while parsing a value at line 1 column 0

rbw 1.8.3
linux 6.6.3.arch1-1

@arcstur
Copy link
Contributor

arcstur commented Dec 7, 2023

Same here. Trying rbw register (and putting client id and secret) is returning

rbw register: failed to log in to bitwarden instance: api request returned error: 400

rbw 1.8.3
linux 6.6.4-arch1-1

@rjc
Copy link

rjc commented Dec 8, 2023

Same here, with the exception that I seem to be able to register with rbw register but am being re-prompted for password constantly with pinentry claiming it isn't correct.

Edit: this is both on a machine where rbw was working previously, and on a new one.

@rjp
Copy link

rjp commented Dec 8, 2023

I've done some debugging and I think that whilst rbw might have some issues (the 400 response, perhaps), I can't get anything other than a 500 back from the bitwarden API by hand following the API descriptions I've found elsewhere. Will have a look at vaultwarden and see if that gives me any clues (assuming that vw is still compatible with the bw API!)

@rjp
Copy link

rjp commented Dec 9, 2023

Have tested against vaultwarden and rbw works fine there. Unhelpful, I know, but it really does seem like bitwarden are doing something weird that isn't specified in their API documentation (which is pretty terrible.)

@yazgoo
Copy link

yazgoo commented Dec 14, 2023

Until this is fixed I'm using this script to emulate my usage of it, more precisely:

  • rbw sync
  • rbw get
  • rbw get --full

All this based on official CLI client (bw)

⚠️ this stores the session in a local file with octal mode 600, use at your own risk

just name this script rbw, make it executable and put it in your path and you should be good.

to log in just do a rbw sync

#!/bin/env bash
set -eu -o pipefail
# emulate rbw wit bw

session_path="$HOME/.local/my_local_file"

bwu() {
    [ -e  "$session_path" ] && source "$session_path"
    BW_STATUS=$(bw status | jq -r .status)
    case "$BW_STATUS" in
    "unauthenticated")
        echo "Logging into BitWarden" >&2
        export BW_SESSION="$(bw login --raw)"
        ;;
    "locked")
        echo "Unlocking Vault" >&2
        export BW_SESSION="$(bw unlock --raw)"
        ;;
    "unlocked")
        echo "Vault is unlocked" >&2
        ;;
    *)
        echo "Unknown Login Status: $BW_STATUS" >&2
        return 1
        ;;
    esac
    bw sync >&2
    echo "export BW_SESSION=\"$BW_SESSION\"" > "$session_path"
    chmod 600 "$session_path"
}

if [ "$#" -eq 0 ]
then
    echo "Usage: rbw <get|sync> [options] <item>"
    exit
fi
case "$1" in
"get")
    source "$session_path"
    shift
    full=0
    for arg in "$@"
    do
        if [ "$arg" = "--full" ]
        then
            full=1
            shift
        fi
    done
    id=$(bw list items --search "$1" |  jq -r ".[] | select(.name==\"$1\") | .id")
    if [ "$full" = "1" ]
    then
        json="$(bw get item "$id")"
        echo "$json" | jq -r '.login.password' | tail -1
        echo "Username: $(echo "$json" | jq -r '.login.username' | tail -1)"
        uris="$(echo "$json" | jq -r '.login.uris')"
        [ "$uris" != "null" ] && echo "URI: $(echo "$json" | jq -r '.login.uris[].uri' | tail -1)"
    else
        bw get item "$id" | jq -r '.login.password' 
    fi
    ;;
"sync")
    bwu 
    ;;
esac

@Msouza91
Copy link

Has anyone else tested #151 fix? I removed previous version of rbw and installed his revision with the proposed fix, but still getting the error message.

@rjc
Copy link

rjc commented Dec 20, 2023

I've just tested the #151 fix - it does resolve the issue!

@joelsleeba
Copy link

#151 fixes it! yayy!!

@00sapo
Copy link

00sapo commented Dec 21, 2023

Confirmed, it works

@Msouza91
Copy link

Msouza91 commented Dec 21, 2023

I might be doing something wrong here, I did and rbw purge, deleted the config file, uninstalled the previous version of rbw, then installed the one from the PR, killed rbw-agent and rebooted my computer, not all at the same time, but that is all what I have done so far and still getting the error message, I checked the cargo checkouts folder and I have the code with the fix in the version installed on my PC.
Thoroughly confused here :( I was so looking forward to try this with rofi-rbw, but I seem to be suffering from a major case of Skill Issue, not sure where else to look to solve this for me...

@rjc
Copy link

rjc commented Dec 21, 2023

@Msouza91 Did your run rbw register?

@Msouza91
Copy link

@rjc Register returns 400 as well, after input of the id and secret.
image

@rjc
Copy link

rjc commented Dec 21, 2023

@Msouza91 Are you a .eu user by any chance? If so, check the issue #148. If not, try on another machine where you previously hadn't used rbw. If it still doesn't work, try rotating the key and/or bumping PBKDF2 rounds. Other than that, I'm running out of ideas.

BTW, I've tested on macOS 14.2.1 and OpenBSD -current.

@Msouza91
Copy link

Regular bitwarden.com user, will try the PBK parameter and rotating keys, thanks for the pointers.

@Msouza91
Copy link

@rjc I was using Argo2id changed back to PBK, still didn't work for me after rotating keys, I'm at a loss, will try a minimal setup on a VM later and see what happens.

@00sapo
Copy link

00sapo commented Dec 21, 2023

I might be doing something wrong here, I did and rbw purge, deleted the config file, uninstalled the previous version of rbw, then installed the one from the PR, killed rbw-agent and rebooted my computer, not all at the same time, but that is all what I have done so far and still getting the error message, I checked the cargo checkouts folder and I have the code with the fix in the version installed on my PC. Thoroughly confused here :( I was so looking forward to try this with rofi-rbw, but I seem to be suffering from a major case of Skill Issue, not sure where else to look to solve this for me...

Try which rbw to check you have not other installations hiding the cargo installation. Then, remove the repo in the .cargo folder and retry (I used --branch option, but --ref should work the same).

@Msouza91
Copy link

Msouza91 commented Dec 26, 2023

@00sapo Well, I only had cargo installed through cargo from the beginning, uninstalled the main version and used the -rev command from the PR to install it again, but didn't work for me, didn't get the time to test on a VM, but it wouldn't change much if it worked on the VM since I can't figure out what is wrong in my main machine.
rbw login returns the same error
image

@00sapo
Copy link

00sapo commented Dec 27, 2023

It says "rbw 1.8.3 is already installed". Remove it and install or use "--force"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.