@@ -55,6 +55,8 @@ const QString QgsAuthManager::smAuthServersTable = "auth_servers";
5555const QString QgsAuthManager::smAuthAuthoritiesTable = " auth_authorities" ;
5656const QString QgsAuthManager::smAuthTrustTable = " auth_trust" ;
5757const QString QgsAuthManager::smAuthManTag = QObject::tr( " Authentication Manager" );
58+ const QString QgsAuthManager::smAuthCfgRegex = " authcfg=([a-z]|[A-Z]|[0-9]){7}" ;
59+
5860
5961QgsAuthManager *QgsAuthManager::instance ()
6062{
@@ -750,12 +752,18 @@ bool QgsAuthManager::configIdUnique( const QString& id ) const
750752 return !configids.contains ( id );
751753}
752754
755+ bool QgsAuthManager::hasConfigId ( const QString &txt ) const
756+ {
757+ QRegExp rx ( smAuthCfgRegex );
758+ return rx.indexIn ( txt ) != -1 ;
759+ }
760+
753761QgsAuthMethodConfigsMap QgsAuthManager::availableAuthMethodConfigs ( const QString &dataprovider )
754762{
755763 QStringList providerAuthMethodsKeys;
756764 if ( !dataprovider.isEmpty () )
757765 {
758- providerAuthMethodsKeys = authMethodsKeys ( dataprovider );
766+ providerAuthMethodsKeys = authMethodsKeys ( dataprovider. toLower () );
759767 }
760768
761769 QgsAuthMethodConfigsMap baseConfigs;
@@ -847,7 +855,7 @@ QString QgsAuthManager::configAuthMethodKey( const QString &authcfg ) const
847855
848856QStringList QgsAuthManager::authMethodsKeys ( const QString &dataprovider )
849857{
850- return authMethodsMap ( dataprovider ).uniqueKeys ();
858+ return authMethodsMap ( dataprovider. toLower () ).uniqueKeys ();
851859}
852860
853861QgsAuthMethod *QgsAuthManager::authMethod ( const QString &authMethodKey )
@@ -1294,7 +1302,7 @@ bool QgsAuthManager::updateNetworkRequest( QNetworkRequest &request, const QStri
12941302 return false ;
12951303 }
12961304
1297- if ( !authmethod->updateNetworkRequest ( request, authcfg, dataprovider ) )
1305+ if ( !authmethod->updateNetworkRequest ( request, authcfg, dataprovider. toLower () ) )
12981306 {
12991307 authmethod->clearCachedConfig ( authcfg );
13001308 return false ;
@@ -1320,7 +1328,7 @@ bool QgsAuthManager::updateNetworkReply( QNetworkReply *reply, const QString& au
13201328 return false ;
13211329 }
13221330
1323- if ( !authmethod->updateNetworkReply ( reply, authcfg, dataprovider ) )
1331+ if ( !authmethod->updateNetworkReply ( reply, authcfg, dataprovider. toLower () ) )
13241332 {
13251333 authmethod->clearCachedConfig ( authcfg );
13261334 return false ;
@@ -1346,7 +1354,7 @@ bool QgsAuthManager::updateDataSourceUriItems( QStringList &connectionItems, con
13461354 return false ;
13471355 }
13481356
1349- if ( !authmethod->updateDataSourceUriItems ( connectionItems, authcfg, dataprovider ) )
1357+ if ( !authmethod->updateDataSourceUriItems ( connectionItems, authcfg, dataprovider. toLower () ) )
13501358 {
13511359 authmethod->clearCachedConfig ( authcfg );
13521360 return false ;
0 commit comments