중요
번역은 여러분이 참여할 수 있는 커뮤니티 활동입니다. 이 페이지는 현재 55.36% 번역되었습니다.
21.1. 인증 시스템 개요
그림 21.1 인증 시스템 개념도
21.1.1. 인증 데이터베이스
인증 시스템은 기본적으로 <profile directory>/qgis-auth.db 위치에 있는 SQLite 데이터베이스 파일에 인증 환경 설정을 저장합니다.
현재의 다른 QGIS 사용자 환경 설정에 영향을 미치지 않고 서로 다른 QGIS 설치본 간에 이 인증 데이터베이스를 이동시킬 수 있습니다. 인증 데이터베이스가 일반적인 QGIS 설정과 완벽하게 분리되어 있기 때문입니다. 환경 설정을 데이터베이스에 처음으로 저장할 때 환경 설정 ID(랜덤한 문자 7개 길이의 알파벳-숫자 문자열)를 생성합니다. 이 ID가 환경 설정을 가리키기 때문에, 관련 인증 정보를 노출시키는 일 없이 ID를 (프로젝트, 플러그인, 또는 설정 파일과 같은) 평문 텍스트 응용 프로그램 구성 요소로 저장할 수 있습니다.
참고
환경 변수 QGIS_AUTH_DB_DIR_PATH 를 사용하거나 또는 QGIS 구동 시 명령 줄에서 --authdbdirectory 옵션을 설정해서 qgis-auth.db 의 상위(부모) 디렉터리를 설정할 수 있습니다.
21.1.2. 사용자 정의 인증 데이터베이스
QGIS가 앞에서 이야기한 기본 SQLite 데이터베이스 대신 사용자 정의 인증 데이터베이스를 사용하도록 환경설정할 수 있습니다. Qt SQL 모듈이 지원하는 모든 데이터베이스(예: PostgreSQL, MySQL 등등)를 사용할 수 있습니다. 물론 시스템 상에 해당 데이터베이스의 Qt SQL 드라이버가 설치되어 있어야 하겠죠.
사용자가 여러 QGIS 설치본들 사이에서 동일한 인증 데이터베이스를 공유하길 원한다거나, 기본 SQLite 데이터베이스가 아닌 다른 인증 데이터베이스를 사용하길 원한다거나, 또는 QGIS 서버가 중앙 집중형(centralized) 인증 데이터베이스를 사용하고 있는 경우 이 기능이 유용할 수 있습니다.
사용자 정의 인증 데이터베이스를 환경설정할 수 있는 유일한 방법은 driver://username:password@hostname:port/database?options 형식의 연결 URI에 환경 변수 QGIS_AUTH_DB_URI 를 설정하는 것입니다.
- 이때:
driver: 사용할 Qt SQL 드라이버의 이름, 예: PostgreSQL은QPSQL, MySQL은QMYSQL등등username: 데이터베이스에 연결하기 위해 쓰이는 사용자명password: 데이터베이스에 연결하기 위해 쓰이는 비밀번호hostname: 데이터베이스 서버의 호스트명port: 데이터베이스 서버의 포트 번호database: 사용할 데이터베이스의 이름options: 드라이버로 전송할 옵션들, 예: PostgreSQL의 경우sslmode=require등등
참고
URI 옵션에서 schema 를 지정할 수 있습니다. 예: QPSQL://username:password@hostname:port/database?schema=schema_name
QGIS를 시작하기 전에 데이터베이스가 존재하고 있어야만 하며, 사용자는 데이터베이스에 연결하기 위해 필요한 권한과 필수 테이블이 존재하지 않을 경우 생성할 수 있는 권한을 가지고 있어야만 합니다.
경고
URI에서 비밀번호는 환경 변수 안에 평문으로 저장되기 때문에, 비밀번호가 없는 사용자명 또는 데이터베이스에 제한적인 권한으로 연결되는 사용자명을 사용할 것을 권장합니다.
경고
SQLite을 기반으로 하지 않는 모든 데이터베이스는 읽기 전용으로 간주될 것입니다. (필요한 경우 파이썬 플러그인을 통해 변경할 수 있습니다.)
이 고급 기능은 QGIS가 하나 이상의 사용자 정의 인증 데이터베이스를 사용할 수 있도록, 또는 QGIS가 사용할 자격 증명 저장소를 사용자가 직접 파이썬으로 구현할 수 있도록 설계되었습니다.
이 시스템은 여러 개의 인증 데이터베이스를 사용할 수 있도록 설계되었지만, 지금으로써는 여러 자격 증명 저장소를 관리할 수 있는 사용자향 인터페이스가 존재하지 않습니다. 즉 인증 데이터베이스를 여러 개 사용하고 싶다면, 대부분의 경우 파이썬 플러그인을 통해 수동으로 환경설정하고 관리해야 합니다.
21.1.3. 마스터 비밀번호
데이터베이스 내에 민감한 정보를 저장하거나 접근하려면, 사용자가 마스터 비밀번호 를 정의해야만 합니다. 데이터베이스에 암호화된 데이터를 처음으로 저장할 때 새 마스터 비밀번호를 요청하고 확인합니다. 사용자가 민감한 정보에 접근할 때 마스터 비밀번호를 입력해야 합니다. 사용자가 캐시값을 수동으로 삭제하지만 않는다면 남은 세션 동안 (응용 프로그램을 종료할 때까지) 마스터 비밀번호를 캐시에 저장합니다. 기존 인증 환경 설정을 선택한다거나 또는 (WMS 레이어 추가 시처럼) 서버 환경 설정에 인증 환경 설정을 적용한다거나 하는 경우와 같은 인증 시스템을 이용하는 일부 인스턴스는 마스터 비밀번호를 요구하지 않습니다.
사용자 컴퓨터의 Wallet/Keyring 에 비밀번호를 저장하도록 선택할 수 있습니다.
그림 21.2 새 마스터 비밀번호 입력 대화창
참고
환경 변수 QGIS_AUTH_PASSWORD_FILE 을 이용해서 마스터 비밀번호를 담고 있는 파일을 가리키는 경로를 설정할 수 있습니다.
21.1.3.1. 마스터 비밀번호 관리하기
마스터 비밀번호를 설정한 다음, 다시 리셋할 수 있습니다. 리셋하기 전에 현재 마스터 비밀번호를 입력해야 합니다. 이 과정 도중에 현재 데이터베이스의 완전한 백업 파일을 생성하는 옵션이 있습니다.
그림 21.3 마스터 비밀번호 리셋하기
사용자가 마스터 비밀번호를 잊어버린 경우, 다시 찾거나 무시할 수 있는 방법은 없습니다. 또 마스터 비밀번호 없이 암호화된 정보를 받아올 수 있는 방법도 없습니다.
사용자가 기존 비밀번호를 세 번 부정확하게 입력한 경우, 대화창이 데이터베이스를 삭제하도록 제안할 것입니다.
그림 21.4 부정확한 시도를 세 번 한 후의 QGIS 비밀번호 메시지
21.1.4. 인증 환경 설정
QGIS 옵션 대화창의 () Authentication 탭에 있는 Configurations 부분에서 인증 환경 설정을 관리할 수 있습니다.
그림 21.5 환경 설정 편집기
To create a new authentication configuration:
Provide a Name and optional Resource URL
A seven-characters ID will be assigned to the configuration for identification purpose. It can be customized after you pressed the
Unlock to edit ID button.
Be aware that updating that ID may break things.Select the target method and fill the corresponding connection details
Once done, click Save to save the configuration. The saved configuration appears in the list of authentication configurations and can be used with supported connections.
The saved configuration can later be edited using
Edit selected configuration
or removed using
Delete selected configuration.
그림 21.6 환경 설정 편집기 안에서 환경 설정 추가하기
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.
그림 21.7 WMS connection dialog showing authentication configuration widget
인증 환경 설정을 생성하거나 편집할 때, 요구되는 정보는 이름, 인증 방법, 그리고 인증 방법이 요구하는 기타 정보입니다. (사용할 수 있는 인증 유형에 관한 자세한 내용은 인증 방법 을 참조하세요.)
21.1.5. 인증 방법
QGIS가 데이터 제공자 플러그인을 지원하는것과 거의 동일한 방식으로 C++ 플러그인이 사용 가능한 인증을 제공합니다. QGIS 코드와 플러그인을 둘 다 지원하는지 여부와 HTTP(S), 데이터베이스 같은 리소스/제공자에 필요한 접근 권한에 따라 인증 방법을 선택할 수 있습니다. 따라서 일부 인증 방법 플러그인은 인증 환경 설정 선택기가 표시된 모든 위치에 적용이 안 될 수도 있습니다. 메뉴를 선택한 다음 Authentication 탭에 있는
Installed Plugins 버튼을 클릭하면 사용 가능한 인증 방법 플러그인과 호환 가능한 리소스/제공자 목록을 볼 수 있습니다.
그림 21.8 사용할 수 있는 인증 방법 플러그인 목록
QGIS를 다시 컴파일할 필요가 없는 경우 새 인증 방법을 위한 플러그인을 생성할 수 있습니다. 현재 C++ 플러그인만을 지원하고 있기 때문에, 새로 추가한 플러그인을 사용하려면 QGIS를 재시작해야 합니다. 기존 QGIS 설치본에 플러그인을 추가할 생각이라면, 사용자 플러그인이 기존 설치본과 동일한 버전을 대상으로 컴파일됐는지 확인하십시오.
21.1.5.1. API Header Authentication
The API Header authentication method allows you to connect to services
that require custom HTTP headers, such as API keys.
For example, if a WMS service requires an API key sent as a header
(e.g. X-API-KEY), you can use this method to provide it.
You can add one or more headers with the
button; provide a
Header Name and Header Value for each entry. Use
to delete the selected header or the Clear
button to remove all entries.
그림 21.9 API Header authentication configs
21.1.5.2. AWS S3 Authentication
The AWS S3 authentication method allows you to connect to Amazon S3 resources by providing a Name, Resource, Username, Password, and Region.
그림 21.10 AWS S3 authentication configs
21.1.5.3. Basic Authentication
The Basic authentication method is used for services that require standard HTTP authentication with a Username, Password and Realm.
그림 21.11 HTTP 기본 인증 환경 설정
21.1.5.4. ESRI Token Authentication
The ESRI token authentication method is used for ArcGIS REST Servers that require token-based authentication.
그림 21.12 ESRI 토큰 인증 환경 설정
21.1.5.5. Identity certificate authentication
The Identity certificate authentication method allows you to connect using a client identity certificate.
그림 21.13 Identity-cert authentication configs
21.1.5.6. MapTiler HMAC-SHA256 Authentication
The MapTiler HMAC-SHA256 authentication method is used to connect to MapTiler services that require HMAC-SHA256 authorization.
그림 21.14 MapTiler HmacSha256 authentication configs
21.1.5.7. OAuth2 Authentication
The OAuth2 authentication method is used to connect to services that require OAuth2 2.0 authorization, allowing secure access using client credential and token-based authentication.
It supports using localhost as the redirect host,
providing compatibility with services that do not accept http://127.0.0.1 redirects (for example, Microsoft SharePoint).
An advanced OAuth2 configuration option, Extra token header(s), allows attaching additional tokens returned by the OAuth2 token endpoint as HTTP(S) request headers.
그림 21.15 OAuth2 인증 환경 설정
21.1.5.8. PKI-Paths Authentication
The PKI-Paths authentication method allows you to connect using separate certificate and key files stored on your system.
그림 21.16 PKI 경로 인증 환경 설정
21.1.5.9. PKI-PKCS#12 Authentication
The PKI-PKCS#12 authentication method allows you to connect using a single bundle file containing both the certificate and private key, with an optional passphrase for the key.
그림 21.17 PKI PKCS#12 파일 경로 인증 환경 설정
21.1.6. 마스터 비밀번호 및 인증 환경 설정 유틸리티
Authentication 탭의 옵션 메뉴에서 () 인증 데이터베이스 및 환경 설정을 관리할 수 있는 유틸리티 액션이 몇 개 있습니다:
그림 21.18 유틸리티 목록
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 the Wallet: adds the master password to your personal Wallet/Keyring
Clear the master password from the Wallet…: 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.
Import authentication configurations from file…: imports from an
.XMLfile details for creating custom authentication configurations.Export selected authentication configurations to file…: exports the selected items to a possibly encrypted
.XMLfile.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.
21.1.7. 인증 환경 설정 사용하기
일반적으로, (WMS 같은) 네트워크 서비스 용 환경 설정 대화창에서 인증 환경 설정을 선택합니다. 하지만 인증이 필요한 곳이라면 어디든, 또는 제3자 PyQGIS 또는 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. Use the drop-down menu to select an existing authentication
configuration or press
Create a new autentication configuration
to create a configuration you could use.
More details at 인증.
그림 21.19 선택한 환경 설정을 표시한 인증 환경 설정 선택기
21.1.8. 파이썬 바인딩
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.
마스터 비밀번호를 입력하고 나면, 파이어폭스 작동 방식과 비슷하게 API가 열려 인증 데이터베이스에 있는 인증 환경 설정에 접근할 수 있습니다. 하지만 PyQGIS 접근을 막는 어떤 방화벽도 정의되지 않은 상태입니다. 인증 정보에 접근할 수 있는 악성 PyQGIS 플러그인 또는 독립형 응용 프로그램을 다운로드해서 설치한 경우 문제가 발생할 수도 있습니다.