Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4329ab67
Commit
4329ab67
authored
Jun 10, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also look for Kerberos users
parent
8a56c2c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
21 deletions
+5
-21
lib/gitlab/auth.rb
lib/gitlab/auth.rb
+5
-21
No files found.
lib/gitlab/auth.rb
View file @
4329ab67
module
Gitlab
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
module
Auth
Result
=
Struct
.
new
(
:user
,
:type
)
Result
=
Struct
.
new
(
:user
,
:type
)
...
@@ -43,6 +23,11 @@ module Gitlab
...
@@ -43,6 +23,11 @@ module Gitlab
def
find_in_gitlab_or_ldap
(
login
,
password
)
def
find_in_gitlab_or_ldap
(
login
,
password
)
user
=
User
.
by_login
(
login
)
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.
# If no user is found, or it's an LDAP server, try LDAP.
# LDAP users are only authenticated via LDAP
# LDAP users are only authenticated via LDAP
if
user
.
nil?
||
user
.
ldap_user?
if
user
.
nil?
||
user
.
ldap_user?
...
@@ -101,7 +86,6 @@ module Gitlab
...
@@ -101,7 +86,6 @@ module Gitlab
token
=
Doorkeeper
::
AccessToken
.
by_token
(
password
)
token
=
Doorkeeper
::
AccessToken
.
by_token
(
password
)
token
&&
token
.
accessible?
&&
User
.
find_by
(
id:
token
.
resource_owner_id
)
token
&&
token
.
accessible?
&&
User
.
find_by
(
id:
token
.
resource_owner_id
)
end
end
>>>>>>>
cea3cf177c68bb1fa9326d4e88631b7737ae8a98
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment