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
8772c2a1
Commit
8772c2a1
authored
Sep 11, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for multiple ldap omniauth strategies
parent
cd1d5b20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
config/initializers/7_omniauth.rb
config/initializers/7_omniauth.rb
+8
-0
config/initializers/devise.rb
config/initializers/devise.rb
+11
-9
No files found.
config/initializers/7_omniauth.rb
0 → 100644
View file @
8772c2a1
module
OmniAuth::Strategies
class
Ldap0
<
LDAP
;
end
class
Ldap1
<
LDAP
;
end
class
Ldap2
<
LDAP
;
end
class
Ldap3
<
LDAP
;
end
class
Ldap4
<
LDAP
;
end
class
Ldap5
<
LDAP
;
end
end
\ No newline at end of file
config/initializers/devise.rb
View file @
8772c2a1
...
...
@@ -211,15 +211,17 @@ Devise.setup do |config|
email_stripping_proc
=
->
(
name
)
{
name
}
end
config
.
omniauth
:ldap
,
host:
Gitlab
.
config
.
ldap
[
'host'
],
base:
Gitlab
.
config
.
ldap
[
'base'
],
uid:
Gitlab
.
config
.
ldap
[
'uid'
],
port:
Gitlab
.
config
.
ldap
[
'port'
],
method:
Gitlab
.
config
.
ldap
[
'method'
],
bind_dn:
Gitlab
.
config
.
ldap
[
'bind_dn'
],
password:
Gitlab
.
config
.
ldap
[
'password'
],
name_proc:
email_stripping_proc
Gitlab
.
config
.
ldap
.
servers
.
each_with_index
do
|
server
,
i
|
config
.
omniauth
:"ldap
#{
i
}
"
,
host:
server
[
'host'
],
base:
server
[
'base'
],
uid:
server
[
'uid'
],
port:
server
[
'port'
],
method:
server
[
'method'
],
bind_dn:
server
[
'bind_dn'
],
password:
server
[
'password'
],
name_proc:
email_stripping_proc
end
end
Gitlab
.
config
.
omniauth
.
providers
.
each
do
|
provider
|
...
...
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