Hi,

Thanks for the hint; unfortunately I’m still on version 3.4.7 and that plugin 
requires version 3.6 or above.

Thanks,
Paul

From: Alessandro Pasotti <apaso...@gmail.com>
Sent: 24 July 2019 13:22
To: Paul Wittle <p.wit...@dorsetcc.gov.uk>
Cc: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] Using QgsAuthManager

Hi,

you may try this nice plugin from Richard: 
http://plugins.qgis.org/plugins/qgisnetworklogger/

On Wed, Jul 24, 2019 at 2:19 PM Paul Wittle 
<paul.wit...@dorsetcouncil.gov.uk<mailto:paul.wit...@dorsetcouncil.gov.uk>> 
wrote:
Hi,

I’m trying to use python to assign an authentication configuration to a WMS 
layers that I’m adding. I have been using the following guide 
https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/authentication.html#leave-authcfg-expansion-to-qgsauthmanager.

I had to update a few bits as I think some of the code maybe a little out of 
date but I managed to get it all working right down to the section I’ve linked 
to.

The line  “rlayer = QgsRasterLayer(quri.encodedUri(), 'states', 'wms')” was 
resulting in an unexpected type error as encodedUri returns a QByteArray rather 
than a string but I just wrapped it in str(quri.encodedUri()) and that now 
returns as a string.

The only trouble is that the getCapabilities statement fails and no layer is 
added.

Does anyone know how I can see whether the AuthManager attempted to expand the 
authcfg and send credentials as I suspect it didn’t in my case?

Sorry if this email is too much along the developer lines for this mailing list 
but it is only plugin development rather than actual development of the 
application itself so I thought I’d try my luck.

Thanks,
Paul
This e-mail and any files transmitted with it are intended solely for the use 
of the individual or entity to whom they are addressed. It may contain 
unclassified but sensitive or protectively marked material and should be 
handled accordingly. Unless you are the named addressee (or authorised to 
receive it for the addressee) you may not copy or use it, or disclose it to 
anyone else. If you have received this transmission in error please notify the 
sender immediately. All traffic may be subject to recording and/or monitoring 
in accordance with relevant legislation. Any views expressed in this message 
are those of the individual sender, except where the sender specifies and with 
authority, states them to be the views of Dorset Council. Dorset Council does 
not accept service of documents by fax or other electronic means. Virus 
checking: Whilst all reasonable steps have been taken to ensure that this 
electronic communication and its attachments whether encoded, encrypted or 
otherwise supplied are free from computer viruses, Dorset Council accepts no 
liability in respect of any loss, cost, damage or expense suffered as a result 
of accessing this message or any of its attachments. For information on how 
Dorset Council processes your information, please see 
www.dorsetcouncil.gov.uk/416433<http://www.dorsetcouncil.gov.uk/416433>
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org<mailto:Qgis-user@lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


--
Alessandro Pasotti
w3:   www.itopen.it<http://www.itopen.it>
This e-mail and any files transmitted with it are intended solely for the use 
of the individual or entity to whom they are addressed. It may contain 
unclassified but sensitive or protectively marked material and should be 
handled accordingly. Unless you are the named addressee (or authorised to 
receive it for the addressee) you may not copy or use it, or disclose it to 
anyone else. If you have received this transmission in error please notify the 
sender immediately. All traffic may be subject to recording and/or monitoring 
in accordance with relevant legislation. Any views expressed in this message 
are those of the individual sender, except where the sender specifies and with 
authority, states them to be the views of Dorset Council. Dorset Council does 
not accept service of documents by fax or other electronic means. Virus 
checking: Whilst all reasonable steps have been taken to ensure that this 
electronic communication and its attachments whether encoded, encrypted or 
otherwise supplied are free from computer viruses, Dorset Council accepts no 
liability in respect of any loss, cost, damage or expense suffered as a result 
of accessing this message or any of its attachments. For information on how 
Dorset Council processes your information, please see 
www.dorsetcouncil.gov.uk/416433
_______________________________________________
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