Hi,

I'm trying to change credential after a successful login, but without
success, and I wonder it's not possible, so I ask to the community what's
I'm doing wrong.
The only way I found to login as new user is closing and opening again qgis
:|

the workflow it this one

first correct login

1) get a QgsNetworkAccessManager instance
2) prepare a request
3) auth is required by the server => QgisApp::namAuthenticationRequired is
called
4) in QgisApp::namAuthenticationRequired QgsCredential get(...) is used to
ask user and password that are set in the QAuthenticator

all proceed well... but at a moment my plugin need to be used by other
user, so next steps for a new requests are

5) get a QgsNetworkAccessManager instance
6) prepare a request
7) auth is required by the server, but QNetwarkAccessManager use cached
credentials and NO signal AuthenticationRequired => it doesn't enter
in QgisApp::namAuthenticationRequired => no credential are requested and
continue with the old credentials

QNetworkAccessManager reuse "old" QAutenticator so it is unuseful set new
credentials with QgsCredentials::instance().put(). QgsCredentials are get
only in QgisApp::namAuthenticationRequired that is called once (due the
fact that QgsNetworkAccessManager is singleton?)

next QT version (qt5) has a QNetorkAccessManager::clearAccessCache().
Method not available in QT4.

Should I use directly QNetworkAccessManager instead of then singleton
version forced by QgsNetworkAccessManager?

anyone know a way

Any help is appreciated,

Luigi Pirelli (luigi.pire...@faunalia.it - lui...@gmail.com)
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to