Giter Site home page Giter Site logo

Comments (2)

swiesend avatar swiesend commented on August 27, 2024 1

Short: yes, but this is a not so well documented feature of my library:

Named collections can be unlocked without a prompt as they make use of the of the org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface.unlockWithMasterPassword(DBusPath collection, Secret master) API.

If a collection secret (so-called master password) is present, then it automatically gets used to unlock the collection if necessary, but does not lock the collection again. This might be unwanted behavior and can't be configured for now. The only way to ensure that a collection stays Locked is to call SimpleCollection.lock() after each interaction with the collection.

One can provide an empty collection secret (null) for named SimpleCollections, which results in the following behaviors:

New CollectionLockedUnlocked
default collection: SimpleCollection()???always prompts (the default password never gets stored)no prompt or prompts for the password only once for certain tasks (getSecrets(), deleteItem(), deleteItems())
named collection with secret: SimpleCollection("name", "secret") no promptno promptno prompt
named collection, no secret: SimpleCollection("name", null) or no prompt (with magic entry)no prompt

Ticking Automatically unlock this keyring whenever I'm logged in results into an extra entry (I call it a magic entry, as those entries only appear after a user login / system restart in seahorse) in the default collection, which stores the collection secret. So GNOME searches for such entry Unlock password for: My Collection (with a key-value pair attribute like: keyring: LOCAL:/keyrings/My_Collection.keyring) in the default collection and if there is non present will prompt for the password.

By the way, the actual internal collection id (in the dbus path) may differ from the collection name, as there is a mapping between the names. e.g.: "My Collection" gets translated to /org/freedesktop/secrets/collection/My_5fCollection.

You can check that the collection actually gets locked with:

  • SimpleCollection.isLocked(), which is a remote dbus call
  • seahorse
  • or via dbus-send

from secret-service.

shahzaibj avatar shahzaibj commented on August 27, 2024

@swiesend Thanks, this is helpful. I was trying it out and I actually didn't see any checkbox for Automatically unlock this keyring whenever I'm logged in. Is there some specific thing I need to do to get that checkbox? (I was trying it out on WSL and not sure if that is the reason...I will try on a real system later as well)

from secret-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.