Commit 4329ab67 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Also look for Kerberos users

parent 8a56c2c0
module Gitlab
<<<<<<< HEAD
class Auth
def find(login, password)
user = User.by_login(login)
if Devise.omniauth_providers.include?(:kerberos)
kerberos_user = Gitlab::Kerberos::Authentication.login(login, password)
return kerberos_user if kerberos_user
end
# If no user is found, or it's an LDAP server, try LDAP.
# LDAP users are only authenticated via LDAP
if user.nil? || user.ldap_user?
# Second chance - try LDAP authentication
return nil unless Gitlab::LDAP::Config.enabled?
Gitlab::LDAP::Authentication.login(login, password)
else
user if user.valid_password?(password)
=======
module Auth
Result = Struct.new(:user, :type)
......@@ -43,6 +23,11 @@ module Gitlab
def find_in_gitlab_or_ldap(login, password)
user = User.by_login(login)
if Devise.omniauth_providers.include?(:kerberos)
kerberos_user = Gitlab::Kerberos::Authentication.login(login, password)
return kerberos_user if kerberos_user
end
# If no user is found, or it's an LDAP server, try LDAP.
# LDAP users are only authenticated via LDAP
if user.nil? || user.ldap_user?
......@@ -101,7 +86,6 @@ module Gitlab
token = Doorkeeper::AccessToken.by_token(password)
token && token.accessible? && User.find_by(id: token.resource_owner_id)
end
>>>>>>> cea3cf177c68bb1fa9326d4e88631b7737ae8a98
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment