How to use LDAP with htaccess file in rails

Can anyone help me set up LDAP using .htaccess method is Ruby on
Rails. I have been looking on line for hours and there are some
examples, but know examples explain where to put things in the rails
directories and what file names to use. I have seen references to
ruby-net-ldap as well, but the examples incomplete. Any help would be
appreciated.

thanks in advance.

-Wayne

Hi!

  1. First you configure your apache to read you LDAP server.
    Look into apache documentation:
    http://httpd.apache.org/docs/2.0/mod/mod_auth_ldap.html
    I’m not sure if you can use .htaccess for this one. Try by
    “virtualhost” configuration.

  2. After you login to site with HTTP authentication your requests
    should contain user credentials.
    Debug your seesion to see whats inside “request” object.

… or …

You can avoid apache configuration and you write your own devise
adapter that will connect to LDAP.
Devise: https://github.com/plataformatec/devise
Devise HTTP Authentication:
https://github.com/plataformatec/devise/wiki/How-To:-Use-HTTP-Authentication

Hope that this helps you :slight_smile:

  • Oto

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs