Hi Martin,

No worries.

Thanks,
Jay

On Mar 6, 10:56 pm, Martin Sandiford <[email protected]> wrote:
> Hi Jay,
>
>
>
>
>
>
>
>
>
> On Tue, Mar 6, 2012 at 2:55 AM, JayP <[email protected]> wrote:
> > [...]
> > Here is the code that I have:
>
> >        def valid_credentials?(username, password)
> >          return false if password.blank?
> >          @connection  = @connection_type.new({:encryption =>
> > @encryption,
> >                 :host => @server,
> >                 :port => @port,
> >                 :base => @base_dn})
> >          @connection.auth(@ldap_server_user, @ldap_server_pass)
> >          result = @connection.bind_as(:filter =>
> > "(sAMAccountName=#{username})", :password => password)
> >          result ? true : false
> >        end
>
> > I had to create new instance variables: @ldap_server_user and
> > @ldap_server_pass which I set in authentication.yml these are
> > credentials I have to use to bind to the ldap server.  Then I use the
> > actual user and password for the user trying to login to bind_as which
> > will validate the user.
>
> Sorry I came to this a bit late.  There is a merge request (181) to
> get this into mainline 
> here:https://gitorious.org/gitorious/mainline/merge_requests/181
>
> I guess this is kind of moot as you seem to have already solved your
> own problem :)
>
> Cheers,
> Martin

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]

Reply via email to