OpenLdapにLINUXユーザーアカウントを作ったけどその他の情報もLDAPに入れておきたかったので作ったSchema

/etc/openldap/schema フォルダーに ldapusers.schema を作成した。

[text]
attributetype ( 1.1.2.1.1.500.1
NAME ‘userName’
DESC ‘jp.compsys user name UTF8’
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch <—- filter の部分文字列検索するためには必要か?!
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} )

attributetype ( 1.1.2.1.1.500.2
NAME 'mailAddress'
DESC 'jp.compsys email address'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

attributetype ( 1.1.2.1.1.500.3
NAME 'mailAddressMobile'
DESC 'jp.compsys mobile email address'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

objectclass ( 1.1.2.1.1.100.1
NAME 'personalInfo'
DESC 'jp.compsys personal information'
SUP top AUXILIARY
MAY ( userName $ mailAddress $ mailAddressMobile ) )

[/text]

/etc/openldap/slapd.conf にldapusers.schema を追加する。修正したら slapd を再起動する。
[text]
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema
include /etc/openldap/schema/ppolicy.schema
include /etc/openldap/schema/collective.schema
include /etc/openldap/schema/ldapusers.schema <—–ここ
[/text]

javaで使うときは
[text]
// objectClass(必須)
Attribute attrObjClass = new BasicAttribute(“objectClass”);
attrObjClass.add(0, “top”);
attrObjClass.add(1, “account”);
attrObjClass.add(2, “posixAccount”);
attrObjClass.add(3, “personalInfo”);
attrs.put(attrObjClass);
[/text]

コメントを書く


Warning: Undefined variable $user_ID in /home/r6519429/public_html/tamura.jp/wp-content/themes/tamura_thema1/comments.php on line 156