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

Hi there,


good news! We just published a dynamic folder sample for Bitwarden.

You can get the sample here: https://github.com/royalapplications/toolbox/blob/master/Dynamic%20Folder/Bitwarden/Bitwarden%20(Python).rdfe


For instructions on how to import the dynamic folder into Royal TS/X, please see this page: https://www.royalapps.com/go/dynamicfolder-samples


Please let us know if it works for you!


cheers,

felix


1 person likes this
Hi Jivko, yes, that should work. As the dynamic folder script uses the Bitwarden CLI, you should be able to configure the CLI to use your own server. See the documentation for reference: https://help.bitwarden.com/article/cli/#config Hope that helps! Cheers, Felix

1 person likes this

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

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

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

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

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...)

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

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 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

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


 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

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...

In this case, your best option for finding out what's wrong is to copy the script into a standalone file, replace all tokens ($) with actual values, then run it from terminal and observe the output.
Login or Signup to post a comment