LDAP authentication with user binding

Added by João Paulo Ribeiro almost 10 years ago

Dear all,

Praises for the team and community.

My network here at Fujitsu (Portugal) has Active Directory and I can't bind anonymously.
They will not give me a read only user and I really don't care.

I did a quick and dirty hack on app/models/auth_source_ldap.rb

  def authenticate(login, password)
    return nil if login.blank? || password.blank?
    attrs = []
    # get user's DN
    # FIXME
    ldap_con = initialize_ldap_con("EUROPE\\#{login}", password)

and then a can bind and connect to LDAP (AD) and provide authentication.

What do you think?
Is it worth to consider this "use case"?

Replies (1)

RE: LDAP authentication with user binding - Added by Bernhard Furtmueller almost 10 years ago

João Paulo Ribeiro wrote:

Dear all,

Praises for the team and community.

My network here at Fujitsu (Portugal) has Active Directory and I can't bind anonymously.
They will not give me a read only user and I really don't care.

I did a quick and dirty hack on app/models/auth_source_ldap.rb

[...]

and then a can bind and connect to LDAP (AD) and provide authentication.

What do you think?
Is it worth to consider this "use case"?

I had actually the same problem, here my proposed patch ... (against 0.9-stable)
(my first hack was the same as yours :)

I tried to make this more general though.

patch0.patch Magnifier (20.3 KB)

(1-1/1)