Class: Devise::Strategies::LdapAuthenticatable

Inherits:
Authenticatable
  • Object
show all
Defined in:
lib/devise_ldap_authenticatable/strategy.rb

Overview

Strategy for signing in a user based on his login and password using LDAP. Redirects to sign_in page if it’s not authenticated

Instance Method Summary collapse

Instance Method Details

#authenticate!Object

Authenticate a user based on login and password params, returning to warden success and the authenticated user if everything is okay. Otherwise redirect to sign in page.



11
12
13
14
15
16
17
18
# File 'lib/devise_ldap_authenticatable/strategy.rb', line 11

def authenticate!
  resource = valid_password? && mapping.to.authenticate_with_ldap(params[scope])
  if validate(resource)
    success!(resource)
  else
    fail(:invalid)
  end
end