認証に Devise LDAP を使用する Rails アプリを維持しています。Active Directory から、同じ構造でセットアップした OpenLDAP に移行しています。OpenLdap は、apt-get
パッケージslapd
を使用してldap-utils
、Ubuntu クライアント 12.04 64 ビットのインストール時にインストールされました。
OpenLdapに対して認証できますが、呼び出すと
Devise::LdapAdapter.get_ldap_entry(email)["memberOf"]
空の配列を返しています。Rails コンソールで、返された LDAP エントリに " " エントリがないことがわかりますmemberOf
。
端末から LDAP サーバーにクエリを実行すると、次の出力が表示されます。
ldapsearch -H ldapi:/// -x -b "cn=people,dc=example,dc=local" memberOf
...
# fred fred, people, example.local
dn: cn=fred fred,cn=people,dc=example,dc=local
memberOf: cn=Authorisers,ou=example,dc=example,dc=local
...
Deviseに異なる結果を返す理由をldapsearch
知っている人はいますか?また、 memberOf 属性を返す方法を知っている人はいますか?
前もって感謝します
LDAP 認証に関連する gem は (Bundle からの出力)
Using devise (2.1.2)
Using net-ldap (0.2.2)
Using devise_ldap_authenticatable (0.6.1)
Using activesupport (3.2.9)
Using activemodel (3.2.9)
Using sprockets (2.2.2)
Using mail (2.4.4)
Using activerecord (3.2.9)
Using activeresource (3.2.9)