Best practice to log in a repository database (Windows)

Wonder what is the best practice to authenticate a database user for Windows app’s repository database.

My Windows application uses a PostgreSQL as a repository and the App saves all monitoring information in there and retrieves it to make a graph…
As you know, as soon as the App starts it needs to log in the database with a password.
As for the password, do you typically save the password in your code to log in? Or, it prompts your input for the password?

I think it is more convenient to save it in your code.
I would like to know how you achieve this requirement.

It is certainly more convenient to have it in code. However, make sure you to go to pain to obfuscate your password and maybe even the IP/host name. If you don’t anyone can literally open your app in a text editor and look for strings. There are multiple tools out there to do it but one that we put is http://www.bkeeney.com/obfuscate/.

Thank you for this Bob!!! I was looking into this as well. :slight_smile: