doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
611 stars 84 forks source link

unable to login due to JSON parse failure #57

Closed andreiple closed 3 years ago

andreiple commented 3 years ago

My config looks this way

{ "email": "@.com", "base_url": null, "identity_url": null, "lock_timeout": 3600, "pinentry": "pinentry" }

When I try login with "rbw login" it returns: rbw login: failed to log in to bitwarden instance: failed to parse JSON: .: expected value at line 1 column 1: expected value at line 1 column 1

I checked agent out/err files, both are empty.

rbw version is 1.2.0 installed on Ubuntu 20.04 from deb package. I googled a bit about Bitwarden Public API and failed to find any mention about email/password authentication, but rather client_id/key. I wonder if they changed the authentication recently?

as3ii commented 3 years ago

Since yesterday I've the same issue.

already tried running rbw purge and deleting $HOME/.config/rbw/config.json to start over from 0

jonathannerat commented 3 years ago

I tried debugging this, and the response from the API after trying to log in is error code: 1020, and looks like the status code is 403. There's a similar issue from 2019 at bitwarden/browser#1017.

~Maybe it's related to the recent change regarding the use of openssl?~

EDIT: Looks like free organizations accounts don't have access to APIs: https://bitwarden.com/pricing/business/. Maybe personal accounts as well?

as3ii commented 3 years ago

I don't know why, but today rbw restarted working normally... Totally randomly

jonathannerat commented 3 years ago

Yeah, it's working fine now. Maybe it had something to do with cloudflare in the end? Guess we'll never know

andreiple commented 3 years ago

Yeah. All good now. Gonna close the ticket

dataO1 commented 2 years ago

This happened to me as well. Not sure what it is, i tried clearing cache and config and disabled 2-factor auth for testing if it has something to do with it. Any new ideas, what this could be?

Lesik commented 1 year ago

For me, the problem was that I was copying the client_id from the browser by double-clicking and copy-pasting. However, double-clicking also (invisibly) selected one space character before and one after the client id, making it invalid of course. In the rbw key entry window, use the "show in clear text" button on the right to verify you're pasting in the information you're intending to.