开发者

LDAP and Ruby on Rails

开发者 https://www.devze.com 2022-12-21 06:12 出处:网络
I\'m trying to connect to an existing LDAP server to authenticate users trying to use my app – I\'m having trouble figuring out where to start.

I'm trying to connect to an existing LDAP server to authenticate users trying to use my app – I'm having trouble figuring out where to start.

I've read about开发者_运维技巧 LDAP, understand how it works, and have looks at libs like ActiveLdap.

I'm just not sure where to start from here: I have the hostname of the server I was to authenticate against (bind with), but I don't know how to go about doing it.

(The answers on SO are quite, quite old, and links are broken!)

Thanks!


You will need, in addition to the hostname (and port, if non-standard), a DN to authenticate against (look at it as the DN identifying your "user", e.g. cn=BillG,ou=engineering,o=microsoft) as well as the corresponding password.

See LDAP::Conn.bind (assuming not using SSL, in which case you'd use LDAP::SSLConn); please read through this tutorial for full examples.

0

精彩评论

暂无评论...
验证码 换一张
取 消