10

I have a QGIS project, based on data from a PostgreSQL database. In this database I create an extra user, with limited rights. I want to give this project to other users, but I don't want that they have to enter the login data everytime they open the project. Therefore I store the connection to the database and the login data in the qgis_global_settings file and replace it on the PC of every project user. It works fine and they can use the database, but if they want to open the project, the have to enter a master password. I never set any master password.

Where is the master password in QGIS stored?

Is there any file that I can give to the user, maybe in the qgis_global_settings or the qgis3.ini?

I do not want the user to have to enter any login data.

1
  • 3
    Look at the qgis-auth.db file in the /QGIS/QGIS3/profiles/default/ directory under .local/share for ubuntu or %appdata% for Windows. Commented Feb 12, 2020 at 12:42

1 Answer 1

10

Instead of using this, you should use a .pg_service.conf file associated with a .pgpass file There is a recipe for this purpose. This recipe use system wide variable environment. You can play also with custom variables to set variable environments within QGIS only. This solution does not answer directly to your question but to the intent behind the question to manage connection to DB avoiding typing password or using a master DB password

If you really want to find the qgis-auth.db file that contains master password stored info, run within PyQGIS print(QgsApplication.qgisAuthDatabaseFilePath()) to get it path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.