5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'app/processors/casino/processor_concern/authentication.rb', line 5
def validate_login_credentials(username, password)
authentication_result = nil
authenticators.each do |authenticator_name, authenticator|
begin
data = authenticator.validate(username, password)
rescue CASino::Authenticator::AuthenticatorError => e
Rails.logger.error "Authenticator '#{authenticator_name}' (#{authenticator.class}) raised an error: #{e}"
end
if data
authentication_result = { authenticator: authenticator_name, user_data: data }
Rails.logger.info("Credentials for username '#{data[:username]}' successfully validated using authenticator '#{authenticator_name}' (#{authenticator.class})")
break
end
end
authentication_result
end
|