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
Tatuya Kamada
gitlab-ce
Commits
12e60846
Commit
12e60846
authored
Apr 11, 2016
by
Patricio Cano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow `external_providers` for Omniauth to be defined to mark these users as external
parent
4087bd16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-0
lib/gitlab/o_auth/user.rb
lib/gitlab/o_auth/user.rb
+12
-0
No files found.
config/initializers/1_settings.rb
View file @
12e60846
...
@@ -129,6 +129,7 @@ Settings['omniauth'] ||= Settingslogic.new({})
...
@@ -129,6 +129,7 @@ Settings['omniauth'] ||= Settingslogic.new({})
Settings
.
omniauth
[
'enabled'
]
=
false
if
Settings
.
omniauth
[
'enabled'
].
nil?
Settings
.
omniauth
[
'enabled'
]
=
false
if
Settings
.
omniauth
[
'enabled'
].
nil?
Settings
.
omniauth
[
'auto_sign_in_with_provider'
]
=
false
if
Settings
.
omniauth
[
'auto_sign_in_with_provider'
].
nil?
Settings
.
omniauth
[
'auto_sign_in_with_provider'
]
=
false
if
Settings
.
omniauth
[
'auto_sign_in_with_provider'
].
nil?
Settings
.
omniauth
[
'allow_single_sign_on'
]
=
false
if
Settings
.
omniauth
[
'allow_single_sign_on'
].
nil?
Settings
.
omniauth
[
'allow_single_sign_on'
]
=
false
if
Settings
.
omniauth
[
'allow_single_sign_on'
].
nil?
Settings
.
omniauth
[
'external_providers'
]
=
[]
if
Settings
.
omniauth
[
'external_providers'
].
nil?
Settings
.
omniauth
[
'block_auto_created_users'
]
=
true
if
Settings
.
omniauth
[
'block_auto_created_users'
].
nil?
Settings
.
omniauth
[
'block_auto_created_users'
]
=
true
if
Settings
.
omniauth
[
'block_auto_created_users'
].
nil?
Settings
.
omniauth
[
'auto_link_ldap_user'
]
=
false
if
Settings
.
omniauth
[
'auto_link_ldap_user'
].
nil?
Settings
.
omniauth
[
'auto_link_ldap_user'
]
=
false
if
Settings
.
omniauth
[
'auto_link_ldap_user'
].
nil?
Settings
.
omniauth
[
'auto_link_saml_user'
]
=
false
if
Settings
.
omniauth
[
'auto_link_saml_user'
].
nil?
Settings
.
omniauth
[
'auto_link_saml_user'
]
=
false
if
Settings
.
omniauth
[
'auto_link_saml_user'
].
nil?
...
...
lib/gitlab/o_auth/user.rb
View file @
12e60846
...
@@ -54,6 +54,14 @@ module Gitlab
...
@@ -54,6 +54,14 @@ module Gitlab
@user
||=
build_new_user
@user
||=
build_new_user
end
end
unless
@user
.
nil?
if
external_provider?
@user
.
external
=
true
else
@user
.
external
=
false
end
end
@user
@user
end
end
...
@@ -113,6 +121,10 @@ module Gitlab
...
@@ -113,6 +121,10 @@ module Gitlab
end
end
end
end
def
external_provider?
Gitlab
.
config
.
omniauth
.
external_providers
.
include?
(
auth_hash
.
provider
)
end
def
block_after_signup?
def
block_after_signup?
if
creating_linked_ldap_user?
if
creating_linked_ldap_user?
ldap_config
.
block_auto_created_users
ldap_config
.
block_auto_created_users
...
...
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