Important

Translation is a community effort you can join. This page is currently translated at 43.08%.

25.1. Prezentare Generală a Sistemului de Autentificare

../../../_images/auth-system-overview.png

Fig. 25.1 Anatomia Sistemului de Autentificare

25.1.1. Baza de date de autentificare

The new authentication system stores authentication configurations in an SQLite database file located, by default, at <profile directory>/qgis-auth.db.

Această bază de date de autentificare poate fi mutată între instalările QGIS, fără afectarea altor preferințe ale utilizatorului QGIS curent, deoarece este complet separată de setările normale ale QGIS. Atunci când stocați inițial o configurație a unei baze de date, este generat un ID de configurare (un șir aleatoriu de 7 caractere alfanumerice). Acesta reprezintă configurația, fiind posibilă stocarea în clar a ID-ului de către componentele aplicației, (cum ar fi proiectele, plugin-urile, sau fișierele de setare) fără divulgarea credențialelor asociate.

Notă

Directorul părinte al qgis-auth.db poate fi setat folosind variabila de mediu QGIS_AUTH_DB_DIR_PATH, sau din linia de comandă, pe durata lansării cu opțiunea --authdbdirectory.

25.1.2. Parola master

To store or access sensitive information within the database, a user must define a master password. A new master password is requested and verified when initially storing any encrypted data to the database. When sensitive information is accessed, the user is prompted for the master password. The password is then cached for the remainder of the session (until application is quit), unless the user manually chooses an action to clear its cached value. Some instances of using the authentication system do not require input of the master password, such as when selecting an existing authentication configuration, or applying a configuration to a server configuration (such as when adding a WMS layer).

You can choose to save the password in the Wallet/Keyring of your computer.

../../../_images/auth-password-new_enter.png

Fig. 25.2 Introducerea noii parole master

Notă

A path to a file containing the master password can be set using the following environment variable, QGIS_AUTH_PASSWORD_FILE.

25.1.2.1. Gestiunea parolei master

Odată stabilită, parola principală poate fi resetată; parola master curentă va fi necesară înainte de resetare. Pe durata acestui proces, există opțiunea de a genera o copie de rezervă completă a bazei de date curente.

../../../_images/auth-password-reset.png

Fig. 25.3 Resetarea parolei master

În cazul în care utilizatorul uită parola principală, nu există nici o modalitate de a o recupera sau de a o suprascrie. De asemenea, nu există nici un mijloc de recuperare a informațiilor criptate, fără a cunoaște parola de master.

Dacă un utilizator introduce incorect, de trei ori, parola, fereastra de dialog se va oferi să șteargă baza de date.

../../../_images/auth-password-invalid-3times.png

Fig. 25.4 Se va cere parola după trei încercări eronate

25.1.3. Configurații de Autentificare

You can manage authentication configurations from Configurations in the Authentication tab of the QGIS Options dialog (Settings ► Options).

../../../_images/auth-editor-configs2.png

Fig. 25.5 Editorul de configurații

Use the symbologyAdd button to add a new configuration, the symbologyRemove button to remove configurations, and the symbologyEdit button to modify existing ones.

../../../_images/auth-config-create_authcfg-id.png

Fig. 25.6 Adăugarea configurărilor din cadrul Editorului de Configurații

The same type of operations for authentication configuration management (Add, Edit and Remove) can be done when configuring a given service connection, such as configuring an OWS service connection. For that, there are action buttons within the configuration selector for fully managing configurations found within the authentication database. In this case, there is no need to go to the configurations in Authentication tab of QGIS options unless you need to do more comprehensive configuration management.

../../../_images/auth-selector-wms-connection.png

Fig. 25.7 WMS connection dialog showing Add, Edit, and Remove authentication configuration buttons

When creating or editing an authentication configuration, the info required is a name, an authentication method and any other info that the authentication method requires (see more about the available authentication types in Metoda de Autentificare).

25.1.4. Metoda de Autentificare

Available authentications are provided by C++ plugins much in the same way data provider plugins are supported by QGIS. The method of authentication that can be selected is relative to the access needed for the resource/provider, e.g. HTTP(S) or database, and whether there is support in both QGIS code and a plugin. As such, some authentication method plugins may not be applicable everywhere an authentication configuration selector is shown. A list of available authentication method plugins and their compatible resource/providers can be accessed going to Settings ► Options and, in the Authentication tab, click the options Installed Plugins button.

../../../_images/auth-method-listing.png

Fig. 25.8 Available method plugins list

Plugins can be created for new authentication methods that do not require QGIS to be recompiled. Since the support for plugins is currently C++-only, QGIS will need to be restarted for the new dropped-in plugin to become available to the user. Ensure your plugin is compiled against the same target version of QGIS if you intend to add it to an existing target install.

../../../_images/auth-config-create_basic-auth.png

Fig. 25.9 Configurări de autentificare HTTP de bază

../../../_images/auth-config-create_esritoken.png

Fig. 25.10 ESRI Token authentication configs

../../../_images/auth-config-create_oauth2.png

Fig. 25.11 OAuth2 authentication configs

../../../_images/auth-config-create_pem-der-paths.png

Fig. 25.12 Configurări de autentificare ale căilor PKI

../../../_images/auth-config-create_pkcs12-paths.png

Fig. 25.13 Configurări de autentificare ale căilor către fișierele PKI PKCS#12

../../../_images/auth-config-create_stored-identity2.png

Fig. 25.14 Configurări de autentificare ale Identităților Stocate

Notă

The Resource URL is currently an unimplemented feature that will eventually allow a particular configuration to be auto-chosen when connecting to resources at a given URL.

25.1.5. Utilitare pentru Parola Master și Configurările de Autentificare

Under the Options menu (Settings ► Options) in the Authentication tab, there are several utility actions to manage the authentication database and configurations:

../../../_images/auth-editor-configs_utilities-menu.png

Fig. 25.15 Meniul Utilitarelor

  • Input master password: opens the master password input dialog, independent of performing any authentication database command

  • Clear cached master password: unsets the master password if it has been set

  • Reset master password: opens a dialog to change the master password (the current password must be known) and optionally back up the current database

  • Clear network authentication access cache: clears the authentication cache of all connections

  • Automatically clear network authentication access cache on SSL errors: the connection cache stores all authentication data for connections, also when the connection fails. If you change authentication configurations or certification authorities, you should clear the authentication cache or restart QGIS. When this option is checked, the authentication cache will be automatically cleared every time an SSL error occurs and you choose to abort the connection

  • Integrate master password with your Wallet/Keyring: adds the master password to your personal Wallet/Keyring

  • Store/update the master password in your Wallet/Keyring: updates the changed master password in your Wallet/Keyring

  • Clear the master password from your Wallet/Keyring: deletes the master password from your Wallet/Keyring

  • Enable password helper debug log: enables a debug tool that will contain all the log information of the authentication methods

  • Clear cached authentication configurations: clears the internal lookup cache for configurations, used to speed up network connections. This does not clear QGIS’s core network access manager’s cache, which requires a relaunch of QGIS.

  • Remove all authentication configurations: clears the database of all configuration records, without removing other stored records.

  • Erase authentication database: schedules a backup of the current database and complete rebuild of the database table structure. The actions are scheduled for a later time, to ensure that other operations, like project loading, do not interrupt the operation or cause errors due to a temporarily missing database.

    ../../../_images/auth-db-erase.png

    Fig. 25.16 Meniul de verificare a ștergerii DB

25.1.6. Folosirea configurațiilor de autentificare

În mod tipic, o configurație de autentificare este selectată într-un dialog de configurare, pentru serviciile de rețea (cum ar fi WMS). Cu toate acestea, controlul grafic de selectare poate fi încorporat oriunde este necesară autentificarea, sau într-o funcționalitate care nu este de esențială, cum ar fi plugin-urile terțe PyQGIS sau C++.

When using the selector, No authentication is displayed in the pop-up menu control when nothing is selected, when there are no configurations to choose from, or when a previously assigned configuration can no longer be found in the database. The Type and Id fields are read-only and provide a description of the authentication method and the config’s ID respectively.

../../../_images/auth-selector-no-authentication.png

Fig. 25.17 Authentication configuration selector with no authentication

../../../_images/auth-selector-pkcs12-authentication.png

Fig. 25.18 Authentication configuration selector with selected config

25.1.7. Legături Python

All classes and public functions have sip bindings, except QgsAuthCrypto, since management of the master password hashing and auth database encryption should be handled by the main app, and not via Python.

Once the master password is entered, the API is open to access authentication configs in the authentication database, similar to how Firefox works. However, no wall against PyQGIS access has been defined. This may lead to issues where a user downloads/installs a malicious PyQGIS plugin or standalone app that gains access to authentication credentials.