3.8. unicornidm.template.google(5)¶
3.8.1. 概要¶
unicornidm.conf, templates/<name>.py
3.8.2. 説明¶
バックエンドセクションのうち、 type が google となっているバックエンドは、 Google Apps への接続に関する設定を行います。
各バックエンドには必ずテンプレートファイルを用意する必要があります。 テンプレートファイルとは Unicorn ID Manager の任意属性をバックエンド固有の属性に マッピングするためのものです。
3.8.3. パラメーター¶
- type
- バックエンドのタイプを指定します。
- domain
- 接続する Google Apps のドメイン名を指定します。
- bind_user
- Google Apps の管理者を指定します。
- json_key_path
- Google Apps で API を利用するための設定をする際に生成される JSON key ファイルのパスを指定します。
- backend_primary_key_user
- ユーザーを一意に特定するための Google Apps 属性を指定します。 デフォルト値は primaryEmail です。
- backend_primary_key_group
- グループを一意に特定するための Google Apps 属性を指定します。 デフォルト値は email です。
3.8.4. テンプレート¶
以下は、 google のテンプレートファイルの例です。
User = {
"primaryEmail": userName,
"name": {
"givenName": givenName,
"familyName": familyName,
},
"password": password,
"hashFunction": "crypt", # SHA-1 or MD5 or crypt
"orgUnitPath": default(orgUnitPath, "/"),
"changePasswordAtNextLogin": default(changePasswordAtNextLogin, False),
"suspended": not default(active, True),
}
Group = {
"email": groupName,
"description": default(description),
}
注意すべき点は以下のとおりです。
User の辞書には必ず次の属性を付与すること
- primaryEmail
- name.givenName
- name.familyName
- password
Group の辞書には必ず email 属性を付与すること
User 属性に hashFunction を付与する場合、必ず crypt か SHA-1 か MD5 を指定すること