Class: AuthSource
Class Method Summary
collapse
Instance Method Summary
collapse
cipher_key, decrypt_text, encrypt_text, included, logger
included
#delete_unsafe_attributes, included, #safe_attribute?, #safe_attribute_names, #safe_attributes=
Class Method Details
.allow_password_changes? ⇒ Boolean
Does this auth source backend allow password changes?
91
92
93
|
# File 'app/models/auth_source.rb', line 91
def self.allow_password_changes?
false
end
|
.authenticate(login, password) ⇒ Object
Try to authenticate a user not yet registered against available sources
96
97
98
99
100
101
102
103
104
105
106
107
108
|
# File 'app/models/auth_source.rb', line 96
def self.authenticate(login, password)
AuthSource.where(:onthefly_register => true).each do |source|
begin
logger.debug "Authenticating '#{login}' against '#{source.name}'" if logger && logger.debug?
attrs = source.authenticate(login, password)
rescue => e
logger.error "Error during authentication: #{e.message}"
attrs = nil
end
return attrs if attrs
end
return nil
end
|
.search(q) ⇒ Object
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'app/models/auth_source.rb', line 72
def self.search(q)
results = []
AuthSource.all.each do |source|
begin
if source.searchable?
results += source.search(q)
end
rescue AuthSourceException => e
logger.error "Error while searching users in #{source.name}: #{e.message}"
end
end
results
end
|
Instance Method Details
#account_password ⇒ Object
60
61
62
|
# File 'app/models/auth_source.rb', line 60
def account_password
read_ciphered_attribute(:account_password)
end
|
#account_password=(arg) ⇒ Object
64
65
66
|
# File 'app/models/auth_source.rb', line 64
def account_password=(arg)
write_ciphered_attribute(:account_password, arg)
end
|
#allow_password_changes? ⇒ Boolean
86
87
88
|
# File 'app/models/auth_source.rb', line 86
def allow_password_changes?
self.class.allow_password_changes?
end
|
#auth_method_name ⇒ Object
56
57
58
|
# File 'app/models/auth_source.rb', line 56
def auth_method_name
"Abstract"
end
|
#authenticate(login, password) ⇒ Object
50
51
|
# File 'app/models/auth_source.rb', line 50
def authenticate(login, password)
end
|
#searchable? ⇒ Boolean
68
69
70
|
# File 'app/models/auth_source.rb', line 68
def searchable?
false
end
|
#test_connection ⇒ Object
53
54
|
# File 'app/models/auth_source.rb', line 53
def test_connection
end
|