Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'net/ldap'
- def authenticate_login
- username = params[:username]
- password = params[:password]
- ldap = Net::LDAP.new
- ldap.host = '(YOUR LDAP HOST)'
- ldap.port = 389
- ldap.auth "MAINOFFICE\\#{username}", password
- if ldap.bind && password != '' && !password.nil?
- ##Logged in successfully
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement