Ruby on rails 如何使ldap与rails中的Desive一起工作?

Ruby on rails 如何使ldap与rails中的Desive一起工作?,ruby-on-rails,ruby-on-rails-3,devise,ldap,Ruby On Rails,Ruby On Rails 3,Devise,Ldap,我正在使用Desive,我尝试使用ldap,所有的尝试都失败了。 我跟着 我真的在寻求帮助 Started POST "/users/sign_in" for 127.0.0.1 at 2013-04-16 18:01:54 +0530 Processing by Devise::SessionsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"N7Xkqk8nHWqK4tgiCx

我正在使用Desive,我尝试使用ldap,所有的尝试都失败了。 我跟着 我真的在寻求帮助

Started POST "/users/sign_in" for 127.0.0.1 at 2013-04-16 18:01:54 +0530
Processing by Devise::SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"N7Xkqk8nHWqK4tgiCxyX4wFccSO8ozhy+nxXqS19arA=", "user"=>{"email"=>"logesh@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
WARNING: Can't verify CSRF token authenticity
  User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."email" = 'logesh@gmail.com' LIMIT 1
  LDAP: LDAP dn lookup: cn=logesh@gmail.com
  LDAP: LDAP search for login: cn=logesh@gmail.com
  LDAP: Authorizing user cn=logesh@gmail.com,dc=server,dc=local
  LDAP: LDAP dn lookup: cn=logesh@gmail.com
  LDAP: LDAP search for login: cn=logesh@gmail.com
DEPRECATION WARNING: an empty resource was given to Devise::Strategies::LdapAuthenticatable#validate. Please ensure the resource is not nil. (called from service at /Users/logesh/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111)
Completed 401 Unauthorized in 13ms
Processing by Devise::SessionsController#new as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"N7Xkqk8nHWqK4tgiCxyX4wFccSO8ozhy+nxXqS19arA=", "user"=>{"email"=>"logesh@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
WARNING: Can't verify CSRF token authenticity
  Rendered devise/shared/_links.erb (0.4ms)
  Rendered devise/sessions/new.html.erb within layouts/application (3.1ms)
Completed 200 OK in 8ms (Views: 6.5ms | ActiveRecord: 0.0ms)
我不知道如何向前迈进。我为此挣扎了大约2天,仍然无法解决


当我注册时,用户保存在用户模型中,但登录不起作用。请帮助我。

是否可能在您使用的LDAP目录中,而不是命名属性为
cn=logesh@gmail.com
,而mail属性具有该值,完整DN不是:
cn=logesh@gmail.com,dc=服务器,dc=本地

因此,如果可能,您的配置应该搜索邮件=logesh@gmail.com然后从该用户对象获取DN,然后尝试绑定