I am trying to use the keyring library from Python 3 to store and retrieve credentials for a user. The following simple example should store a password, read it back, and then read both the username and password, but get_credential() is returning None. Did I miss something?
keyring.set_password("KRDemo", "user01", "password")
pw = keyring.get_password("KRDemo", "user01")
print("Password:", pw)
cr = keyring.get_credential("KRDemo", None)
if cr is not None:
print("Username:", cr.username)
print("Password:", cr.password)
I'm on a Linux Mint 20.3 host with Cinnamon desktop.
I am also having the same problem when I run this with sudo it throws None then tried without sudo
Try this below code with sudo and without sudo