認証システムの概要¶

認証システムの構造¶
認証データベース¶
The new authentication system stores authentication configurations in an SQLite
database file located, by default, at <user home>/.qgis3/qgis-auth.db
.
この認証データベースは、それは通常のQGIS設定から完全に分離されているので、他の現在のQGISユーザーの好みに影響を与えることなく、QGISのインストール間で移動できます。最初にデータベースに設定を格納する際に、構成ID(ランダム7文字の英数字文字列)が生成されます。これは設定を表し、これによりIDがその関連する資格情報の開示することなく、プレーンテキストアプリケーションコンポーネント(例えば、プロジェクト、プラグイン、または設定ファイルなど)に格納することを可能にします。
注釈
qgis-auth.db の親ディレクトリは、以下の環境変数、 QGIS_AUTH_DB_DIR_PATH
を使用して設定、または --authdbdirectory
オプションでの起動時にコマンドラインで設定できます。
マスターパスワード¶
格納またはデータベース内の機密情報にアクセスするために、ユーザーは、 マスターパスワード を定義する必要があります。最初にデータベースに任意の暗号化されたデータを保存するときに、新しいマスターパスワードが要求され、検証されます。機密情報がアクセスされた場合にのみ、ユーザーは手動でそのキャッシュされた値をクリアするアクションを選択しない限り、ユーザーは、(アプリケーションが終了されるまで)、セッションの残りのためにキャッシュされるマスターパスワードの入力を求めています。認証システムを使用することのいくつかの例は、既存の認証設定を選択する、または(例えば、WMSレイヤーを追加する場合など)、サーバー構成に設定を適用する場合のように、マスターパスワードの入力を必要としません。

入力新しいマスターパスワード¶
注釈
マスターパスワードを含むファイルへのパスは、以下の環境変数、 QGIS_AUTH_PASSWORD_FILE
を使用して設定できます。
マスターパスワードの管理¶
一度設定すると、マスターパスワードはリセットできます。現在のマスターパスワードはリセットする前に必要になるでしょう。このプロセスの間には、現在のデータベースの完全なバックアップを作成するオプションがあります。

マスターパスワードのリセット¶
ユーザーがマスターパスワードを忘れた場合は、それを取得したり、上書きする方法はありません。マスターパスワードを知らずに暗号化された情報を検索する手立てもありません。
ユーザーが既存のパスワードを誤って3回入力すると、ダイアログがデータベースを消去しようとします。

3つの無効な試みの後にパスワードのプロンプト¶
認証設定¶
認証設定はQGIS [オプション]ダイアログ ( 認証 タブ中の 設定 から管理できます。
)の
設定エディタ¶
新しい設定を追加する ボタン、設定を削除する
ボタン、および既存のものを変更する
ボタンを使用できます。

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

WMS connection dialog showing Add, Edit, and Remove authentication configuration buttons¶
認証設定を作成または編集するときに、必要な情報には、名前、認証方法および認証方法が必要であること、他の情報(利用可能な認証の種類についての詳細は 認証方式 を参照)。
認証方式¶
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 Authentication tab, click the Installed Plugins
button.

利用可能なメソッドプラグイン一覧¶
プラグインを再コンパイルするQGISを必要としない新しい認証方法のために作成することができます。プラグインのサポートは現在(QGIS 2.12以降)C ++のみですので、新しいドロップインプラグインがユーザーが利用できるようになるためにはQGISを再起動する必要があります。既存のターゲットインストールに追加する場合は、ご自分のプラグインがQGISの同じターゲットバージョンに対してコンパイルされていることを確認してください。

基本HTTP認証構成¶

ESRI Token authentication configs¶

OAuth2 authentication configs¶

PKIパス認証構成¶

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

保存されたアイデンティティ認証構成¶
注釈
リソースのURLは現在 未実装 の機能で、最終的には指定されたURLにあるリソースへの接続時に特定の構成が自動選択できるようになります。
マスターパスワードと認証構成ユーティリティ¶
( 認証 タブ、認証データベースと構成を管理するには、いくつかのユーティリティアクションがあります。
)オプションメニューの下にある
ユーティリティメニュー¶
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 via input dialog.
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 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.
Reset master password: Replaces the current master password for a new one. The current master password will be needed prior to resetting and a backup of database can be done.
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. These actions are scheduled for a later time, so as to ensure other operations like project loading do not interrupt the operation or cause errors due to a temporarily missing database.
DB消去検証メニュー¶
認証設定を使用する¶
典型的には、認証構成は、(例えば、WMSのような)ネットワークサービスのための設定ダイアログで選択されています。しかし、セレクタウィジェットは、サードパーティのPyQGISまたはC ++プラグインのように、認証が必要などこにでも、または非コア機能中に、埋め込むことができます。
セレクタを使用しているとき、何も選択されていない場合、選択する構成がない場合、または以前に割り当てられた構成がもはやデータベースに見つからない場合は 認証なし がポップアップメニューコントロールに表示されます。 type と Id フィールドは読み取り専用とそれぞれの認証方法の説明と構成のIDを提供しています。

Authentication configuration selector with no authentication¶

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