I try to read username and password from the qgis-auth.db
, the latter having been configured under QGIS (3.6.1, Ubuntu).
Here is my code :
import os
import sys
from qgis.core import QgsApplication
argvb = list(map(os.fsencode, sys.argv))
qgisapp = QgsApplication(argvb, True)
qgisapp.initQgis()
authM = qgisapp.authManager()
authM.setMasterPassword("myMasterPassword", True) # returns True
print(authM.authenticationDatabasePath())
# returns '/home/me/.local/share/profiles/default/qgis-auth.db'
it's not the QGIS3 default profile location, which is :
/home/me/.local/share/QGIS/QGIS3/profiles/default/qgis-auth.db
I'd like to avoid copying the auth database and read it directly from the default profile.