Start a new topic
Implemented

BitWarden Support

Eventually I'm going to move off LastPass (honestly RoyalTS has been keeping me on it lol) but I've been eyeing BitWarden pretty seriously. Is there any plans to add support for that?


Also it's open source: https://github.com/bitwarden


2 people like this idea

 Hello, I've got the following error:


 

C:\Users\user1\RoyalTS>python bitwarden.py -v
? Master password: [hidden]
mac failed.
? Master password: [hidden]
Traceback (most recent call last):
  File "C:\Users\user1\RoyalTS\bitwarden.py", line 296, in <module>
    print(get_entries(bw_path, r"mail@dot.com", r"pass"))
  File "C:\Users\user1\RoyalTS\bitwarden.py", line 276, in get_entries
    list_items_response = json.loads(list_items_json)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

 

Hello, since some time the script is not working. I tried to run it from console. I've got the latest bw.exe 1.13.3 and python 3.9

C:\Users\user1\RoyalTS>python bitwarden.py -v
? Master password: [hidden]
mac failed.
? Master password: [hidden]
Traceback (most recent call last):
  File "C:\Users\user1\RoyalTS\bitwarden.py", line 296, in <module>
    print(get_entries(bw_path, r"mail@dot.com", r"pass"))
  File "C:\Users\user1\RoyalTS\bitwarden.py", line 276, in get_entries

    list_items_response = json.loads(list_items_json)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Hi Francis,


did you try running the script outside of Royal TSX? If so, what's the output?

If you don't want to post such info publicly, please open a new support ticket.


thx,

felix

I used brew to install in but , still no success....


I think TK comes pre-installed on macOS but don't quote me on that. Otherwise you can of course use pip to install it.

Testing outside of Royal TSX is definitely the best way to troubleshoot.

ok, I am on Mac so I need to figure out how to install Tkinter....

I also wil test in a standalone file, later today...

Hi Francis,


that's right, the script supports 2FA. The popup is not spawned by Royal TS/X though but by the TkInter, which is a dependency for the script as mentioned in the "Notes" section.

Do you have that dependency installed?

The best way to debug dynamic folder issues is to save the script to a standalone file and try running it from a terminal session. That way you should be able to find out what's wrong. Don't forget to replace the tokens ($) with actual values before trying to run it.


cheers,

felix

Hi Felix,


I think I should get a popup message asking me for the 2fa code? If so, I do not get that popup...


Regards,


Francis

Hi Francis,


login is repeated every time you reload the dynamic folder. This means that a new session key is requested every time your reload.

I'm not sure I understand the problem you're having. Could you please elaborate?


thx,

felix

Hi Felix,


How do you have to handle the session key? its now continues reloading and I think it has to do with the session key...


Regards,


Francis

Hi Cee Bee,


that's weird. I haven't been able to create an item (no matter the type) in Bitwarden without a name. Can you share how you managed to do that?


Regarding limiting the scope: You can easily adjust the script to do that.

Take a look at line 271: 

cmd_list_items = [ bw_path, "list", "items", "--session", session_key ]


Here you can add additional parameters to instruct the list command to filter by certain criteria. For possible options, see the Bitwarden documentation: https://help.bitwarden.com/article/cli/#list


If you have something that can be shared with other users, please feel free to send a PR on Github!


Hope that helps!


cheers,

felix

The problem was that i have a entry of type card in the bitwarden vault.
This entry didnt had a name attribut.

This way the royaljson generation failed.

This is why limiting the script to query only for a specified collection would be great (and speed things up in case of big vaults...)

Hey Cee Bee!


First of, I'm glad you got it working. I don't quite understand what you changed that made it work though. Could you please elaborate a little bit? Might be useful for other users.


thx,

felix

Got it working - some custom attributes could be parsed...

To be able to filter by collection would be awesome :-)

and it works...

with python and python3

cb$ python royal.py -v
You are not logged in.
mac failed.
? Master password: [hidden]
Master password is required.

 i need to hit enter twice (no input!) and i see the json...


Login or Signup to post a comment