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

fix incorrect "Username or password is incorrect" error #183

Closed
wants to merge 1 commit into from

Conversation

thimc
Copy link

@thimc thimc commented Jun 2, 2024

Hi,

I hacked together a proxy that basically proxies everything bitwarden related on my machine and prints the various requests and responses. I then logged in to bitwarden via the Firefox extension which works (no surprises there) and looked at the logs from my proxy and started comparing each request with what rbw is doing.

I noticed that the client_id query parameter in the /connect/token request is set to desktop but the Firefox extension is setting it to browser. After changing to browser I am now able to login again and I am not getting the "Username or password is incorrect" message.

This PR fixes #182

fixes incorrect "Username or password is incorrect" error
@yasn77
Copy link

yasn77 commented Jun 8, 2024

@doy It would be great if this can be merged

@reidlabwastaken
Copy link

works great for me, don't have the issue anymore

@pfr-dev
Copy link

pfr-dev commented Jun 13, 2024

Seems that this does not fix the issue on all platforms #182

impact-merlinzerbe pushed a commit to impact-merlinzerbe/rbw that referenced this pull request Jun 19, 2024
the official bitwarden cli uses the following parameters when logging
in (POST /connect/token):

```
scope=api offline_access
client_id=cli
deviceType=25
deviceIdentifier=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
deviceName=linux
grant_type=password
username=xxxxxxxxxxxxxxxxxxxxxxxxx
password=xxxxxxxxxxxxxxxxxxxxxxxxx
```

before this commit, rbw uses these parameters:

```
scope=api offline_access
client_id=desktop
deviceType=8
deviceIdentifier=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
deviceName=rbw
devicePushToken=
grant_type=password
username=xxxxxxxxxxxxxxxxxxxxxxxxx
password=xxxxxxxxxxxxxxxxxxxxxxxxx
```

although there are multiple differences, changing the client id from
"desktop" to "cli" is sufficient to fix the issue.
impact-merlinzerbe pushed a commit to impact-merlinzerbe/rbw that referenced this pull request Jun 19, 2024
the official bitwarden cli uses the following parameters when logging
in (POST /connect/token):

```
scope=api offline_access
client_id=cli
deviceType=25
deviceIdentifier=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
deviceName=linux
grant_type=password
username=xxxxxxxxxxxxxxxxxxxxxxxxx
password=xxxxxxxxxxxxxxxxxxxxxxxxx
```

before this commit, rbw uses these parameters:

```
scope=api offline_access
client_id=desktop
deviceType=8
deviceIdentifier=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
deviceName=rbw
devicePushToken=
grant_type=password
username=xxxxxxxxxxxxxxxxxxxxxxxxx
password=xxxxxxxxxxxxxxxxxxxxxxxxx
```

although there are multiple differences, changing the client id from
"desktop" to "cli" is sufficient to fix the issue.
@doy
Copy link
Owner

doy commented Jun 19, 2024

i believe this should be fixed in #186 (i think cli is a better value to use here than browser). thanks for the patch though!

@doy doy closed this Jun 19, 2024
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 this pull request may close these issues.

Username or Password are incorrect. Try Again
5 participants