I am working on a Mac and running QGIS 3.0.3 and I am exploring the authentication db setup.

I have a bunch of layers almost all of which are based on PostGIS queries and I want to move all my authentication into the managed auth_db and it is not clear to me how to proceed.

I assume I will have to edit the project file and replace the database connection parameters with a reference to the id but how should I do this?

One thing I want to achieve with this exercise is to make the project files so they are independent of the user so I can share project files as a starting point for people .

1 Answer 1


I figured it out by the simple expedient of adding a layer using the auth_db and then looking at what went into the project file.

user=<...> gets replaced with authcfg=<...>

so in my case I edited the project file and performed the following replacement Replace string user='rful011' -> authcfg=tiridb1 Then I was able to open the project and have QGIS use the creds in the auth_db associated with 'tiridb1'.

I was surprised not to get prompted for the master passwords and did some more poking around and found that under Preference (Mac) -> Authentication-> Utilities there is a section about storing the master password in the OS keychain (Mac OS built in password manager) and it saves it by default.

enter image description here

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.