do you mind to user QgsNetwrkAccessManager as described in https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/authentication.html
or a way to usbstitute request with a wrapper to QgsNetwrkAccessManager as in: https://github.com/boundlessgeo/lib-qgis-commons/blob/master/qgiscommons2/network/networkaccessmanager.py or using last api introduced by Nyall: https://github.com/qgis/QGIS/pull/8440 and related follow-up pyqgis coockbook should be updated to these new features Luigi Pirelli ************************************************************************************************** * LinkedIn: https://www.linkedin.com/in/luigipirelli * Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli * GitHub: https://github.com/luipir * Mastering QGIS 2nd Edition: * https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition * Hire me: http://goo.gl/BYRQKg ************************************************************************************************** On Wed, 13 Feb 2019 at 16:08, <fuenfer-koenigstein.benja...@swm.de> wrote: > 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
_______________________________________________ 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