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
9f1e9f11
Commit
9f1e9f11
authored
Jan 16, 2013
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2346 from sodabrew/omniauth_configs
Allow the OmniAuth provider args parameter to be passed through
parents
9cab79cb
aec1a840
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
config/gitlab.yml.example
config/gitlab.yml.example
+2
-0
config/initializers/devise.rb
config/initializers/devise.rb
+10
-1
No files found.
config/gitlab.yml.example
View file @
9f1e9f11
...
@@ -72,6 +72,8 @@ omniauth:
...
@@ -72,6 +72,8 @@ omniauth:
# Uncomment the lines and fill in the data of the auth provider you want to use
# Uncomment the lines and fill in the data of the auth provider you want to use
# If your favorite auth provider is not listed you can user others:
# If your favorite auth provider is not listed you can user others:
# see https://github.com/gitlabhq/gitlabhq/wiki/Using-Custom-Omniauth-Providers
# see https://github.com/gitlabhq/gitlabhq/wiki/Using-Custom-Omniauth-Providers
# The 'app_id' and 'app_secret' parameters are always passed as the first two
# arguments, followed by optional 'args' which can be either a hash or an array.
providers:
providers:
# - { name: 'google_oauth2', app_id: 'YOUR APP ID',
# - { name: 'google_oauth2', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET',
# app_secret: 'YOUR APP SECRET',
...
...
config/initializers/devise.rb
View file @
9f1e9f11
...
@@ -217,6 +217,15 @@ Devise.setup do |config|
...
@@ -217,6 +217,15 @@ Devise.setup do |config|
end
end
Gitlab
.
config
.
omniauth
.
providers
.
each
do
|
provider
|
Gitlab
.
config
.
omniauth
.
providers
.
each
do
|
provider
|
case
provider
[
'args'
]
when
Array
# An Array from the configuration will be expanded.
config
.
omniauth
provider
[
'name'
].
to_sym
,
provider
[
'app_id'
],
provider
[
'app_secret'
],
*
provider
[
'args'
]
when
Hash
# A Hash from the configuration will be passed as is.
config
.
omniauth
provider
[
'name'
].
to_sym
,
provider
[
'app_id'
],
provider
[
'app_secret'
],
provider
[
'args'
]
else
config
.
omniauth
provider
[
'name'
].
to_sym
,
provider
[
'app_id'
],
provider
[
'app_secret'
]
config
.
omniauth
provider
[
'name'
].
to_sym
,
provider
[
'app_id'
],
provider
[
'app_secret'
]
end
end
end
end
end
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