0

I am building a Web Application using Ruby on Rails, i want to build authentication with active directory via LDAP. And i have no idea how to authenticate with active directory via LDAP.

Can someone provide me how to code it and where we have to put the code.

Unixmonkey
  • 18,485
  • 7
  • 55
  • 78
iamzouz
  • 99
  • 1
  • 3
  • 11
  • https://stackoverflow.com/questions/334519/ldap-through-ruby-or-rails?rq=1 – Unixmonkey May 29 '19 at 13:27
  • Thank you for your reply. Do I have to configure anything else? any additional resources I can find concerning authentication with Active Directory. I am not sure how to fully implement the example you provided. @Unixmonkey – iamzouz May 29 '19 at 14:41
  • Not really. It calls a service (LDAP) with credentials, and determines if they are valid or not. The rest of it is up to you (but off-topic for this post). Here's a similar implementation that I used a long time ago: https://stackoverflow.com/questions/45013354/how-to-ruby-on-rails-authentication-with-ldap/45015896#45015896 – Unixmonkey May 29 '19 at 14:56
  • okay thank you, and where we have to put this code ? (location) @Unixmonkey – iamzouz May 30 '19 at 07:42
  • It doesn't really matter much, as Rails autoloads just about everything, so classes are available app-wide. `/app/models/ldap.rb` or `app/models/concerns/ldap.rb` seem appropriate to me. – Unixmonkey May 30 '19 at 14:50
  • Thank you, do we have to add some file(or configuration) under /lib or under /config to use LDAP ? @Unixmonkey – iamzouz May 31 '19 at 07:35
  • No, not the way that stand-alone class is currently setup. – Unixmonkey Jun 01 '19 at 12:24

0 Answers0