Reputation: 235
I am writing a script that sends emails using the smtplib. I want to store the username and password so that the user doesn't have to enter it every time and I've found many posts about it, but none to the point. I don't think I need a database to store one username and password (encrypted), but I don't know where to go to. I was skimming through passlib's documentation, but it seems to return only boolean values and I'd need the password and username. Any ideas on how to store them?
Upvotes: 0
Views: 258
Reputation: 4058
I don't know the circumstances but for now I can recommend keyring
The Python keyring lib provides a easy way to access the system keyring service from python. It can be used in any application that needs safe password storage.
You have to set the credentials once in the user account. The user gets access to the password. It's always best practice to have a service user. You will reach the operating systems level of security.
Upvotes: 1