<div dir="ltr"><div class="gmail_extra"><div style=""><span style="font-size:12.8px">Hi Bernhard,</span></div><div style=""><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px">Please note that the Python support for direct access to the credentials via the auth method config *may* be completely removed for security reasons. </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Ideally, the expansion of credentials within a given auth method config would only be done within the core application and connection methods (HTTP, etc.) would be offered through a Python API. In this way an authcfg token can be passed in and the connection established without access to credentials.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">However, such support and an API are not currently available. It is simple enough to add to QgsNetworkAccessManager for HTTP[S] connections, but not so simple for other types of connections, e.g. database via a library or client. Once completed this means a plugin would not be able to access the credentials and pass them on to a different connection method, e.g. Python HTTP lib, etc.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Once such an API is available (or even now, with some work), plugins could be 'authorized' by the user for access to credentials using revocable access tokens or signed/revokable certificates.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Until then, the continued Python access to the auth system credentials means security is not good for the user. It should be considered for deprecation or just complete removal in 2.14 release.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Regards,</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>Larry Shaffer<br>Dakota Cartography<br>Black Hills, South Dakota</div><div><br></div><div><div>QGIS Support/Development | Boundless</div><div><a href="mailto:lshaffer@boundlessgeo.com" target="_blank">lshaffer@boundlessgeo.com</a></div></div></div>
<br><div class="gmail_quote">On Tue, Jan 12, 2016 at 8:14 AM, Bernhard Ströbl <span dir="ltr"><<a href="mailto:bernhard.stroebl@jena.de" target="_blank">bernhard.stroebl@jena.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Luigi,<br>
<br>
many thanks! That was the key.<br>
<br>
I now have<br>
<code><br>
am = QgsAuthManager.instance()<br>
myAuthMethodConfig = QgsAuthMethodConfig()<br>
am.loadAuthenticationConfig(mykey,myAuthMethodConfig,True)<br>
myAuthMethodConfig.configMap()<br>
</code><br>
<br>
Bernhard<div><div class="h5"><br>
<br>
Am 12.01.2016 um 15:58 schrieb Luigi Pirelli:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5">
Hi Bernhard<br>
<br>
be inspired by Boundless qgis-geoserver-plugin<br>
<br>
<a href="https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/src/geoserverexplorer/gui/gsexploreritems.py#L502" rel="noreferrer" target="_blank">https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/src/geoserverexplorer/gui/gsexploreritems.py#L502</a><br>
<br>
I hope it's enough<br>
<br>
cheers<br>
Luigi Pirelli<br>
<br>
**************************************************************************************************<br>
* Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com<br>
* LinkedIn: <a href="https://www.linkedin.com/in/luigipirelli" rel="noreferrer" target="_blank">https://www.linkedin.com/in/luigipirelli</a><br>
* Stackexchange: <a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" rel="noreferrer" target="_blank">http://gis.stackexchange.com/users/19667/luigi-pirelli</a><br>
* GitHub: <a href="https://github.com/luipir" rel="noreferrer" target="_blank">https://github.com/luipir</a><br>
* Mastering QGIS:<br>
<a href="https://www.packtpub.com/application-development/mastering-qgis" rel="noreferrer" target="_blank">https://www.packtpub.com/application-development/mastering-qgis</a><br>
**************************************************************************************************<br>
<br>
<br>
On 12 January 2016 at 12:47, Bernhard Ströbl <<a href="mailto:bernhard.stroebl@jena.de" target="_blank">bernhard.stroebl@jena.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi all,<br>
<br>
my goal is that my users do not save their PostgreSQL passwords in clear<br>
text but that they use the new Authentification system to do so. For my<br>
plugins I would need access to the PostgreSQL username and password, though.<br>
Is this generally possible in spite of security considerations as mentioned<br>
in the QGEP? If yes, how would I do it?<br>
<br>
what I have so far is:<br>
<code><br>
am = QgsAuthManager.instance()<br>
myAuthMethodConfig = am.availableAuthMethodConfigs()[mykey]<br>
myAuthMethodConfig.configMap() # returns an empty dict :-(<br>
</code><br>
<br>
QGIS 2.12.2<br>
<br>
any help appreciated<br>
<br>
regards<br>
<br>
Bernhard<br>
<br>
[1]<br>
<a href="https://github.com/dakcarto/QGIS-Enhancement-Proposals/blob/auth-system/qep-14-authentication-system.rst" rel="noreferrer" target="_blank">https://github.com/dakcarto/QGIS-Enhancement-Proposals/blob/auth-system/qep-14-authentication-system.rst</a><br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus signature<br>
database 12855 (20160112) __________<br>
<br>
The message was checked by ESET Mail Security.<br>
<a href="http://www.eset.com" rel="noreferrer" target="_blank">http://www.eset.com</a><br>
<br>
<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote>
<br>
<br></div></div>
__________ Information from ESET Mail Security, version of virus signature database 12856 (20160112) __________<span class=""><br>
<br>
The message was checked by ESET Mail Security.<br>
<a href="http://www.eset.com" rel="noreferrer" target="_blank">http://www.eset.com</a><br>
<br>
<br>
</span></blockquote>
<br>
-- <br>
Bernhard Ströbl<br>
Anwendungsbetreuer GIS<br>
<br>
Kommunale Immobilien Jena<br>
Am Anger 26<br>
07743 Jena<br>
<br>
Tel.: 03641 49- 5190<br>
E-Mail: <a href="mailto:bernhard.stroebl@jena.de" target="_blank">bernhard.stroebl@jena.de</a><br>
Internet: <a href="http://www.kij.de" rel="noreferrer" target="_blank">www.kij.de</a><br>
<br>
<br>
Kommunale Immobilien Jena<br>
Eigenbetrieb der Stadt Jena<br>
Werkleiter: Karl-Hermann Kliewe<br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus signature database 12856 (20160112) __________<div class=""><div class="h5"><br>
<br>
The message was checked by ESET Mail Security.<br>
<a href="http://www.eset.com" rel="noreferrer" target="_blank">http://www.eset.com</a><br>
<br>
<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></div></div></blockquote></div><br></div></div>