openldapの設定
0. OpenLDAPパッケージの確認
/etc/openldap/schemaディレクトリが存在しない場合は、以下のようにしてOpenLDAPパッケージをインストールしてください。
# yum install openldap-clients openldap-servers
# chkconfig --level 345 ldap on ←自動起動の設定
1. 追加のスキーマファイル
以下のURLには、edupersonスキーマの内容が記載されています。
/etc/openldap/schema 配下に「eduperson.schema」を作成し、スキーマの内容をコピーしてください。
https://spaces.internet2.edu/display/macedir/OpenLDAP+eduPerson
2. ldapのデフォルト設定
/etc/openldap/slapd.conf を変更します。
(省略) include /etc/openldap/schema/eduperson.schema ←入手したスキーマファイルを追加 suffix " o= test_o, dc=ac, c=JP " ←suffix rootdn " cn= olmgr, o= test_o, dc=ac, c=JP " ←rootdn rootpw {CRYPT}olagW85bjtaKc ←暗号化したものを記載
ここで設定したパスワードは IdPの設定ファイルにも記述します。(後述)
※暗号化の例 : 「csildap」というパスワードを暗号化する
# slappasswd -h {crypt} -s csildap
{CRYPT}olagW85bjtaKc ←これをslapd.confのrootpwに記載
3. ldapのテストデータ作成
以下のサンプルを基に、テスト用データを作成し、ldapへ登録します。
Shibboleth を利用したID/パスワードでの認証に使用されるIDはuid 、パスワードは userPassword になります。
・test.ldif ファイル作成
dn: o=test_o,dc=ac,c=JP objectClass: organization o: test_o dn: ou=Test Unit1,o=test_o,dc=ac,c=JP objectClass: organizationalUnit ou: Test Unit1 dn: ou=Test Unit2,o=test_o,dc=ac,c=JP objectClass: organizationalUnit ou: Test Unit2 dn: ou=Test Unit3,o=test_o,dc=ac,c=JP objectClass: organizationalUnit ou: Test Unit3 dn: uid=test001,ou=Test Unit1,o=test_o,dc=ac,c=JP objectClass: eduPerson objectClass: inetOrgPerson uid: test001 o;lang-ja: テスト001_大学 ou: Test Unit1 ou;lang-ja: テスト001_学部1 sn: test001_sn sn;lang-ja: テスト001_sn cn: test001_cn userPassword: test001 givenName: test001_givenname givenName;lang-ja: テスト001_givenname displayName: test001_displayname displayName;lang-ja: テスト001_displayname mail: test001_email@nii.ac.jp eduPersonAffiliation: member dn: uid=test002,ou=Test Unit2,o=test_o,dc=ac,c=JP objectClass: eduPerson objectClass: inetOrgPerson uid: test002 o;lang-ja: テスト002_大学 ou: Test Unit2 ou;lang-ja: テスト002_学部2 sn: test002_sn sn;lang-ja: テスト002_sn cn: test002_cn userPassword: test002 givenName: test002_givenname givenName;lang-ja: テスト002_givenname displayName: test002_displayname displayName;lang-ja: テスト002_displayname mail: test002_email@nii.ac.jp eduPersonAffiliation: faculty dn: uid=test003,ou=Test Unit3,o=test_o,dc=ac,c=JP objectClass: eduPerson objectClass: inetOrgPerson uid: test003 o;lang-ja: テスト003_大学 ou: Test Unit3 ou;lang-ja: テスト003_学部3 sn: test003_sn sn;lang-ja: テスト003_sn cn: test003_cn userPassword: test003 givenName: test003_givenname givenName;lang-ja: テスト003_givenname displayName: test003_displayname displayName;lang-ja: テスト003_displayname mail: test003_email@nii.ac.jp eduPersonAffiliation: student
・ldapへの登録
# ldapadd -x -h localhost -D " cn=olmgr,o=test_o,dc=ac,c=JP " -w csildap -f test.ldif
・設定ファイルの再読み込み
# service sldap restart