LDAP:未授权,因为未在devise_ldap_authenticatable上设置ldap时进行身份验证

时间:2014-06-11 05:59:14

标签: ruby-on-rails devise ldap redmine devise-confirmable

我关注了' https://github.com/cschiewek/devise_ldap_authenticatable'

我在Rails控制台上遇到的错误

  LDAP: LDAP search yielded 0 matches
  LDAP: Not authorized because not authenticated.
Completed 401 Unauthorized in 19ms

我尝试在另一个Rails应用上运行ldap设置' redmine'

Redmine的作品

enter image description here

ldap.yml

development:
  host: dc01.toshiba.tw
  port: 389
  attribute: sAMAccountName
  base: dc=toshiba,dc=tw
  admin_user: redmine.rd@toshiba.tw
  admin_password: adminredmine
  ssl: false
  # <<: *AUTHORIZATIONS

登录页面

<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
  <div><%= f.label :email %><br />
  <%= f.text_field :email, autofocus: true %></div>

devise.rb

Devise.setup do |config|
  # ==> LDAP Configuration 
  # config.ldap_logger = true
  config.ldap_create_user = true
  # config.ldap_update_password = true
  config.ldap_config = "#{Rails.root}/config/ldap.yml"
  # config.ldap_check_group_membership = false
  # config.ldap_check_attributes = true
  # config.ldap_use_admin_to_bind = true
  # config.ldap_ad_group_check = false

1 个答案:

答案 0 :(得分:-1)

发展:   主持人:dc01.toshiba.tw   港口:389   attribute:sAMAccountName   base:dc = toshiba,dc = tw   admin_user:cn = redmine.rd,dc = toshiba,dc = tw   admin_password:adminredmine   ssl:false