# Ldap authentication in ROR

**URL:** <https://www.ruby-forum.com/t/ldap-authentication-in-ror/171451>\
**Category:** Rails\
**Created:** [July 2, 2009, 5:20pm UTC](https://www.ruby-forum.com/t/ldap-authentication-in-ror/171451 "2009-07-02T17:20:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mushi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@mushi](https://www.ruby-forum.com/u/mushi)\
**Post date:** [July 2, 2009, 5:20pm UTC](https://www.ruby-forum.com/t/ldap-authentication-in-ror/171451/1 "2009-07-02T17:20:27Z")

</div>

Hi  
i am new to ROR and working on a project where i just want to  
authenticate a user against our active directory.  
if username and password is correct i want to store his full name in a  
session variable and then wants to redirect that user on a specific  
page.

i just need a simple way, how to bind with ldap and how to authenticate  
a user.

thanks in advance.

mushiii

---

<div class="post-metadata">

**Author:** ![mushi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@mushi](https://www.ruby-forum.com/u/mushi)\
**Post date:** [July 2, 2009, 6:36pm UTC](https://www.ruby-forum.com/t/ldap-authentication-in-ror/171451/2 "2009-07-02T18:36:27Z")

</div>

This might help you get started

> **[Active Directory Authentication for Ruby on Rails](https://www.zorched.net/2007/06/04/active-directory-authentication-for-ruby-on-rails/)**

---

<div class="post-metadata">

**Author:** ![mushi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@mushi](https://www.ruby-forum.com/u/mushi)\
**Post date:** [July 2, 2009, 7:15pm UTC](https://www.ruby-forum.com/t/ldap-authentication-in-ror/171451/3 "2009-07-02T19:15:52Z")

</div>

I did some LDAP authentication awhile ago using the ruby-net-ldap gem.

I pasted some of the key code here (this is some of the first code I  
wrote in Ruby/RoR - it works but may not be the most elegant):  
[http://pastie.org/532258](http://pastie.org/532258)

On Jul 2, 9:36 am, “Älphä Blüë” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
