I'm making a QGIS plugin in which I ask the for authentication object (with QgsProcessingParameterAuthConfig) for the PostgreSQL connection (which is already set in the connecions list of the user). My goal is to take the login and password with PyQGIS and use these to connect with psycopg2.
The asked parameter QgsProcessingParameterAuthConfig returns a string with the identification key of the authentication object.
- I can get the QgsAuthMethodConfig object with this key but the password is empty.
- I didn't found a method to access the password, nor other plugin doing that.
- It is possible to know the SQLite database where the password is saved, but the are encrypted and I don't know the method to decrypt them.