Hi,

I use the OSM Tools plugin in QGIS3. It uses requests library for connecting to 
a OSM routing API. Unfortunately the plugin does not considder proxy settings 
set in Options->Network. I successfully implemented this for credentials set in 
the 'Basic' section by
s = QSettings()
proxy_user = s.value("proxy/proxyUser","")
proxy_password = s.value("proxy/proxyPassword","")

But I have problems to do this with proxy settings with authentification 
configuration. What I got so far is:

a = QgsApplication.authManager()
auth_config = s.value("proxy/authcfg","")
meth = a.availableAuthMethodConfigs()[auth_config]
print(meth.name())

returns the name of auth config I set for proxy, but I cant read credentials 
from the auth config:

print(meth.hasConfig('username'),meth.hasConfig('password'))

returns
False False

Do I use wrong keys for credentials? Do I have to prompt master password for 
auth db to be able to read config?

print(a.masterPasswordIsSet(), a.masterPasswordSame('mymasterpassword'))
returns
            True True


Thanks for any help!

Regards
Benjamin
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to