This is a web extension that allows browsers to connect to the D-Bus service provided by this project. It can be used for testing.
Both Firefox and Edge/Chromium are supported from a unified codebase in add-on/
with browser-specific manifests:
manifest.firefox.json— Firefox (MV3, requires Firefox 140+)manifest.chromium.json— Edge/Chromium (MV3, requires Chrome 111+ or Edge 111+)
This requires some setup to make it work:
Currently, this web extension relies on the dbus-next Python package to
interact with D-Bus services. If you have that package installed in your system
Python, this should work. You can test using the following:
python3 -c 'import dbus_next; print("dbus-next is installed")'If that completes without error, then you're good to go. Otherwise, you have a couple of options:
- Install the system package for your operating system, for example:
# Fedora dnf install python3-dbus-next # Debian/Ubuntu apt install python3-dbus-next # Arch pacman -S python-dbus-next
- Modify the shebang to point to a Python instance that does have the package installed.
cd webext/ python3 -m venv env source ./env/bin/activate pip3 install dbus-next echo "Change the first line in webext/app/credential_manager_shim.py to:" echo "#!$(readlink -f ./env/bin/python3)"
- Follow the instructions in the "For Installing/Testing" section of
BUILDING.md. - Open Firefox and go to
about:debugging. - Click "This Firefox" > Load Temporary Extension. Select
/usr/local/share/credentialsd/credentialsd-firefox-helper.xpi. - Navigate to https://webauthn.io.
- Run through the registration and creation process.
(Note: Paths are relative to root of this repository)
- Copy
webext/app/credential_manager_shim.jsonto~/.mozilla/native-messaging-hosts/xyz.iinuwa.credentialsd_helper.json. - In
webext/app/credential_manager_shim.py, point theDBUS_DOC_FILEvariable to the absolute path todoc/xyz.iinuwa.credentialsd.Credentials.xml. - In the copied file, replace the
pathkey with the absolute path towebext/app/credential_manager_shim.py - Copy the Firefox manifest into place:
cp webext/add-on/manifest.firefox.json webext/add-on/manifest.json
- Open Firefox and go to
about:debugging - Click "This Firefox" > Load Temporary Extension. Select
webext/add-on/manifest.json - Build with
ninja -C ./buildand run the D-Bus services:GSCHEMA_SCHEMA_DIR=build/credentialsd-ui/data ./build/credentialsd-ui/target/debug/credentialsd-ui./build/credentialsd/target/debug/credentialsd
- Navigate to https://webauthn.io.
- Run through the registration and creation process.
(Note: Paths are relative to root of this repository)
- In
webext/app/credential_manager_shim.py, point theDBUS_DOC_FILEvariable to the absolute path todoc/xyz.iinuwa.credentialsd.Credentials.xml. - Copy the Chromium manifest into place (Edge/Chrome require
manifest.json):cp webext/add-on/manifest.chromium.json webext/add-on/manifest.json
- Open Edge and go to
edge://extensions(orchrome://extensionsfor Chrome). - Enable "Developer mode" (toggle in top right).
- Click "Load unpacked" and select the
webext/add-on/directory. - Note the extension ID shown on the extensions page (e.g.,
abcdefghijklmnop...). - Create the native messaging manifest:
Replace
# For Edge: mkdir -p ~/.config/microsoft-edge/NativeMessagingHosts # For Chrome: # mkdir -p ~/.config/google-chrome/NativeMessagingHosts # For Chromium: # mkdir -p ~/.config/chromium/NativeMessagingHosts cat > ~/.config/microsoft-edge/NativeMessagingHosts/xyz.iinuwa.credentialsd_helper.json << EOF { "name": "xyz.iinuwa.credentialsd_helper", "description": "Helper for integrating browser with credentialsd project", "path": "$(readlink -f webext/app/credential_manager_shim.py)", "type": "stdio", "allowed_origins": [ "chrome-extension://YOUR_EXTENSION_ID/" ] } EOF
YOUR_EXTENSION_IDwith the extension ID from step 6. - Build with
ninja -C ./buildand run the D-Bus services:GSCHEMA_SCHEMA_DIR=build/credentialsd-ui/data ./build/credentialsd-ui/target/debug/credentialsd-ui./build/credentialsd/target/debug/credentialsd
- Navigate to https://webauthn.io.
- Run through the registration and creation process.