2

Trying to create new secrets in the GNOME keyring via auth-source results in

The Secrets API auth-source backend doesn’t support creation yet

How can I manually create this secret?

Felipe
  • 329
  • 1
  • 8

1 Answers1

1

The first thing to do is confirm which fields need to be included in the secret. Frequently this includes host and user. For smtp, this also includes port. You can find this information by looking for an auth-source-search call (or using edebug to pause execution on it).

If all you need is host and user, you can use a graphical client like Seahorse if you have it already. Otherwise, you can manually create the secret using Python and secretstorage as follows:

import secretstorage
bus = secretstorage.dbus_init()
collection = secretstorage.get_default_collection(bus)
fields = {'field1': 'field1-value', 'field2': 'field2-value'}
secret = input('Enter secret followed by RET: ')
collection.create_item("Secret name", fields, secret)
Felipe
  • 329
  • 1
  • 8