-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for HTTP Basic authentication #4228
Conversation
hi @tomkralidis IMHO A Core plugin should use QGIS Authentication infrastructure, please have a look to: http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/authentication.html how to manage and save credentials in AuthDb. Thhere is also a sample code to move from httplib to QgsNetworkAccessManager. It can be used to inspire porting credential (and network management) to a uniform way. |
thanks @luipir. Will review and update. |
@tomkralidis if you want a "pythonic" synchronous interface to |
@luipir @elpaso thanks for the info. MetaSearch's HTTP handling is buried deep inside of OWSLib (which does the heavy lifting of the CSW handling we require for MetaSearch), so using something like For HTTP basic auth I have implemented |
you can find example in qgis-geoserver-plugin, but conceptually you have to get a AuthConfig (pointed by authid), from AuthManager. The AuthConfig will have credentials stored in it. the main problem of this way to work, is that is not granted to be ported in QGIS3, due the secure problem to give access with python api to method to access sensible data (also when protected with a master pwd) Give a look to NetworkAccessManager how expand credentials in a request URL starting from authid. |
@tomkralidis are you sure that you cannot config/patch owslib to use |
@elpaso this would need to be an OWSLib enhancement and will take considerable time and effort. Are folks ok if this pull request goes ahead as is and then implements networking correctly once OWSLib is updated? |
@tomkralidis yes, sure, go ahead. |
ba1c8c9
to
d672361
Compare
Travis error is unrelated, merging. |
@elpaso / @luipir merged. Thanks for the feedback and suggestions. FYI new issue to update MetaSearch's HTTP support filed in http://hub.qgis.org/issues/16304. |
As per http://hub.qgis.org/issues/16298