You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In lib/adauth/authenticate.rb the code below is going to result in a “crash” when the search result is empty.
user = Adauth::AdObjects::User.where('sAMAccountName', username).first
if allowed_to_login(user)
Adauth.logger.info("authentication") { "Authentication succesful" }
return user
else
Adauth.logger.info("authentication") { "Authentication failed (not in allowed group or ou)" }
return false
end
Calling the method first on the empty result, results in user being nil, which causes failures further down the path. Could a check be added, so that false is returned if user is nil.
Even better would be to return more error codes or even messages, which can then be displayed in the log-in dialog.
The text was updated successfully, but these errors were encountered:
this code only gets run if the user successfully authenticates which can only happen if the user exists.
As for better errors LDAP gives the same error for any kind of failed login be it wrong password, user that doesn't exist etc... so Adauth would then need to perform extra queries to check if the username you entered exists.
The login/sessions controller/views are supplied to help get you up and running quickly, if you want more functionality out of it then you will need to code that yourself.
In
lib/adauth/authenticate.rb
the code below is going to result in a “crash” when the search result is empty.Calling the method
first
on the empty result, results in user beingnil
, which causes failures further down the path. Could a check be added, so thatfalse
is returned ifuser
isnil
.Even better would be to return more error codes or even messages, which can then be displayed in the log-in dialog.
The text was updated successfully, but these errors were encountered: