22.1. 認証システムの概要

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

図 22.1 認証システムの構造

22.1.1. 認証データベース

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

この認証データベースは、それは通常のQGIS設定から完全に分離されているので、他の現在のQGISユーザーの好みに影響を与えることなく、QGISのインストール間で移動できます。最初にデータベースに設定を格納する際に、構成ID(ランダム7文字の英数字文字列)が生成されます。これは設定を表し、これによりIDがその関連する資格情報の開示することなく、プレーンテキストアプリケーションコンポーネント(例えば、プロジェクト、プラグイン、または設定ファイルなど)に格納することを可能にします。

注釈

qgis-auth.db の親ディレクトリは、以下の環境変数、 QGIS_AUTH_DB_DIR_PATH を使用して設定、または --authdbdirectory オプションでの起動時にコマンドラインで設定できます。

22.1.2. マスターパスワード

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

図 22.2 入力新しいマスターパスワード

注釈

マスターパスワードを含むファイルへのパスは、以下の環境変数、 QGIS_AUTH_PASSWORD_FILE を使用して設定できます。

22.1.2.1. マスターパスワードの管理

一度設定すると、マスターパスワードはリセットできます。現在のマスターパスワードはリセットする前に必要になるでしょう。このプロセスの間には、現在のデータベースの完全なバックアップを作成するオプションがあります。

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

図 22.3 マスターパスワードのリセット

ユーザーがマスターパスワードを忘れた場合は、それを取得したり、上書きする方法はありません。マスターパスワードを知らずに暗号化された情報を検索する手立てもありません。

ユーザーが既存のパスワードを誤って3回入力すると、ダイアログがデータベースを消去しようとします。

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

図 22.4 3つの無効な試みの後にパスワードのプロンプト

22.1.3. 認証設定

認証設定はQGIS [オプション]ダイアログ ( 設定 ► オプション )の 認証 タブ中の 設定 から管理できます。

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

図 22.5 設定エディタ

新しい設定を追加する symbologyAdd ボタン、設定を削除する symbologyRemove ボタン、および既存のものを変更する symbologyEdit ボタンを使用できます。

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

図 22.6 設定エディタから設定を追加

認証構成管理のための操作の同じタイプは、OWSサービス接続を設定するように、所与のサービス接続を設定するときに行うことができる(追加、編集、および削除します)。そのため、完全に認証データベース内で見つかった構成を管理するための構成セレクタ内のアクションボタンがあります。この場合、より包括的な構成管理を行う必要がない限り、QGISオプションの 認証 タブ中の 設定 に行く必要はありません。

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

図 22.7 WMS connection dialog showing Add, Edit, and Remove authentication configuration buttons

認証設定を作成または編集するときに、必要な情報には、名前、認証方法および認証方法が必要であること、他の情報(利用可能な認証の種類についての詳細は 認証方式 を参照)。

22.1.4. 認証方式

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

図 22.8 利用可能なメソッドプラグイン一覧

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

図 22.9 基本HTTP認証構成

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

図 22.10 ESRI Token authentication configs

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

図 22.11 OAuth2 authentication configs

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

図 22.12 PKIパス認証構成

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

図 22.13 PKI PKCS#12ファイルのパス認証構成

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

図 22.14 保存されたアイデンティティ認証構成

注釈

リソースのURLは現在 未実装 の機能で、最終的には指定されたURLにあるリソースへの接続時に特定の構成が自動選択できるようになります。

22.1.5. マスターパスワードと認証構成ユーティリティ

設定 ► オプション )オプションメニューの下にある 認証 タブ、認証データベースと構成を管理するには、いくつかのユーティリティアクションがあります。

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

図 22.15 ユーティリティメニュー

  • 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

    図 22.16 DB消去検証メニュー

22.1.6. 認証設定を使用する

典型的には、認証構成は、(例えば、WMSのような)ネットワークサービスのための設定ダイアログで選択されています。しかし、セレクタウィジェットは、サードパーティのPyQGISまたはC ++プラグインのように、認証が必要などこにでも、または非コア機能中に、埋め込むことができます。

セレクタを使用しているとき、何も選択されていない場合、選択する構成がない場合、または以前に割り当てられた構成がもはやデータベースに見つからない場合は 認証なし がポップアップメニューコントロールに表示されます。 typeId フィールドは読み取り専用とそれぞれの認証方法の説明と構成のIDを提供しています。

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

図 22.17 Authentication configuration selector with no authentication

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

図 22.18 Authentication configuration selector with selected config

22.1.7. Pythonバインディング

すべてのクラスとパブリック関数はSIPバインディングを持っています、 QgsAuthCrypto は除く。マスターパスワードのハッシュと認証データベース暗号化の管理はメインのアプリによって、そしてPythonを経由してではなく、処理されなければならないので。Pythonのアクセスに関しては セキュリティの考慮事項 参照。