LDAP done

This commit is contained in:
vsizov 2012-01-28 16:23:17 +03:00
parent d885f24f7b
commit d6a0b8f428
6 changed files with 37 additions and 24 deletions

View file

@ -0,0 +1,13 @@
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def ldap
# We only find ourselves here if the authentication to LDAP was successful.
omniauth = request.env["omniauth.auth"]["extra"]["raw_info"]
@user = User.find_for_ldap_auth(omniauth)
if @user.persisted?
@user.remember_me = true
end
sign_in_and_redirect @user
end
end