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
b57cf4ae
Commit
b57cf4ae
authored
Jan 27, 2019
by
Imre Farkas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport of ee/9235: Add LDAP integration to smartcard authentication
parent
c2b3f64c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
app/views/devise/sessions/_new_ldap.html.haml
app/views/devise/sessions/_new_ldap.html.haml
+2
-0
lib/gitlab/auth/ldap/adapter.rb
lib/gitlab/auth/ldap/adapter.rb
+11
-8
No files found.
app/views/devise/sessions/_new_ldap.html.haml
View file @
b57cf4ae
-
server
=
local_assigns
.
fetch
(
:server
)
=
form_tag
(
omniauth_callback_path
(
:user
,
server
[
'provider_name'
]),
id:
'new_ldap_user'
,
class:
"gl-show-field-errors"
)
do
.form-group
=
label_tag
:username
,
"
#{
server
[
'label'
]
}
Username"
...
...
lib/gitlab/auth/ldap/adapter.rb
View file @
b57cf4ae
...
...
@@ -30,14 +30,7 @@ module Gitlab
def
users
(
fields
,
value
,
limit
=
nil
)
options
=
user_options
(
Array
(
fields
),
value
,
limit
)
entries
=
ldap_search
(
options
).
select
do
|
entry
|
entry
.
respond_to?
config
.
uid
end
entries
.
map
do
|
entry
|
Gitlab
::
Auth
::
LDAP
::
Person
.
new
(
entry
,
provider
)
end
users_search
(
options
)
end
def
user
(
*
args
)
...
...
@@ -90,6 +83,16 @@ module Gitlab
SEARCH_RETRY_FACTOR
[
retry_number
]
*
config
.
timeout
end
def
users_search
(
options
)
entries
=
ldap_search
(
options
).
select
do
|
entry
|
entry
.
respond_to?
config
.
uid
end
entries
.
map
do
|
entry
|
Gitlab
::
Auth
::
LDAP
::
Person
.
new
(
entry
,
provider
)
end
end
def
user_options
(
fields
,
value
,
limit
)
options
=
{
attributes:
Gitlab
::
Auth
::
LDAP
::
Person
.
ldap_attributes
(
config
),
...
...
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