BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
1_settings.rb
config/initializers/1_settings.rb
+1
-0
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({})
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
[
'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
[
'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?
...
...
lib/gitlab/o_auth/user.rb
View file @
12e60846
...
...
@@ -54,6 +54,14 @@ module Gitlab
@user
||=
build_new_user
end
unless
@user
.
nil?
if
external_provider?
@user
.
external
=
true
else
@user
.
external
=
false
end
end
@user
end
...
...
@@ -113,6 +121,10 @@ module Gitlab
end
end
def
external_provider?
Gitlab
.
config
.
omniauth
.
external_providers
.
include?
(
auth_hash
.
provider
)
end
def
block_after_signup?
if
creating_linked_ldap_user?
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