ruby-on-rails - LDAP:未授权,因为在 devise_ldap_authenticatable 上设置 ldap 时未通过身份验证

标签 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 应用“redmine”上运行 ldap 设置

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>

设计.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

最佳答案

发展: 主机:dc01.toshiba.tw 端口:389 属性:sAMAccountName 基础:dc=东芝,dc=tw admin_user: cn=redmine.rd,dc=toshiba,dc=tw admin_password: adminredmine SSL: 假

关于ruby-on-rails - LDAP:未授权,因为在 devise_ldap_authenticatable 上设置 ldap 时未通过身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24155591/

相关文章:

ruby-on-rails - has_many :through with a foreign key?

ruby-on-rails - Phusion 乘客并使用 apache 运行多个 ruby​​ 版本

ruby-on-rails - 将参数集合从 Controller 传递到模型会破坏 MVC 吗?

ruby-on-rails - Devise SessionsController :create 的未定义方法 `user_url'

ruby-on-rails - 仅当可搜索字段发生变化时才使用太阳黑子索引

php - Web 服务器上的 Ldap 连接

ldap - 在搜索过滤器中使用 DN

c# - 使用 C# 修改 LDAP PhoneNumber 和 IPPhone 属性

javascript - Rails4、Turbolinks 和 select2 : Object [object Object] has no method 'select2'

ruby-on-rails - #<Devise::OmniauthCallbacksController:0x007fb5d1741e48> 的未定义局部变量或方法 `flash'