1

我正在使用设计,我尝试使用 ldap,但我所有的尝试都失败了。我关注了http://vimeo.com/13105005 ,我真的在寻求帮助。

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 天,但仍然无法解决。

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

4

1 回答 1

0

Is it possible that in the LDAP directory you are using, rather than the naming attribute being cn=logesh@gmail.com, rather the mail attribute has that value, and the full DN is something other than: cn=logesh@gmail.com,dc=server,dc=local

Thus, your config, if possible should search for mail=logesh@gmail.com to then get the DN from that user object to then attempt to bind.

于 2013-04-16T17:24:55.163 回答