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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
089605fe
Commit
089605fe
authored
Jun 11, 2013
by
Izaak Alpert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the ldap logins with email or username
Change-Id: I73b4aa4c46afd56ae02fb24abcd673c0724547e4
parent
2c191ab0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
config/gitlab.yml.example
config/gitlab.yml.example
+1
-0
config/initializers/devise.rb
config/initializers/devise.rb
+8
-1
No files found.
config/gitlab.yml.example
View file @
089605fe
...
@@ -97,6 +97,7 @@ production: &base
...
@@ -97,6 +97,7 @@ production: &base
method: 'ssl' # "ssl" or "plain"
method: 'ssl' # "ssl" or "plain"
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
password: '_the_password_of_the_bind_user'
allow_username_or_email_login: true
## OmniAuth settings
## OmniAuth settings
omniauth:
omniauth:
...
...
config/initializers/devise.rb
View file @
089605fe
...
@@ -206,6 +206,12 @@ Devise.setup do |config|
...
@@ -206,6 +206,12 @@ Devise.setup do |config|
# end
# end
if
Gitlab
.
config
.
ldap
.
enabled
if
Gitlab
.
config
.
ldap
.
enabled
if
Gitlab
.
config
.
ldap
.
allow_username_or_email_login
email_stripping_proc
=
Proc
.
new
{
|
name
|
name
.
gsub
(
/@.*$/
,
''
)}
else
email_stripping_proc
=
lambda
{
|
n
|
n
}
end
config
.
omniauth
:ldap
,
config
.
omniauth
:ldap
,
host:
Gitlab
.
config
.
ldap
[
'host'
],
host:
Gitlab
.
config
.
ldap
[
'host'
],
base:
Gitlab
.
config
.
ldap
[
'base'
],
base:
Gitlab
.
config
.
ldap
[
'base'
],
...
@@ -213,7 +219,8 @@ Devise.setup do |config|
...
@@ -213,7 +219,8 @@ Devise.setup do |config|
port:
Gitlab
.
config
.
ldap
[
'port'
],
port:
Gitlab
.
config
.
ldap
[
'port'
],
method:
Gitlab
.
config
.
ldap
[
'method'
],
method:
Gitlab
.
config
.
ldap
[
'method'
],
bind_dn:
Gitlab
.
config
.
ldap
[
'bind_dn'
],
bind_dn:
Gitlab
.
config
.
ldap
[
'bind_dn'
],
password:
Gitlab
.
config
.
ldap
[
'password'
]
password:
Gitlab
.
config
.
ldap
[
'password'
],
name_proc:
email_stripping_proc
end
end
Gitlab
.
config
.
omniauth
.
providers
.
each
do
|
provider
|
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