2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2020-02-18 19:51:31 +00:00
|
|
|
Dir[ Rails.root.join('lib/omniauth/*') ].sort.each do |file|
|
2019-10-28 07:51:22 +00:00
|
|
|
if File.file?(file)
|
|
|
|
require file
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-04-18 07:40:37 +00:00
|
|
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
|
|
|
|
2015-04-30 17:46:06 +00:00
|
|
|
# twitter database connect
|
2017-01-10 21:14:02 +00:00
|
|
|
provider :twitter_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database', {
|
|
|
|
client_options: {
|
|
|
|
authorize_path: '/oauth/authorize',
|
2018-12-19 17:31:51 +00:00
|
|
|
site: 'https://api.twitter.com',
|
2017-01-10 21:14:02 +00:00
|
|
|
}
|
|
|
|
}
|
2012-04-18 07:40:37 +00:00
|
|
|
|
|
|
|
# facebook database connect
|
2017-01-10 21:14:02 +00:00
|
|
|
provider :facebook_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
|
2012-04-18 07:40:37 +00:00
|
|
|
|
|
|
|
# linkedin database connect
|
2017-01-10 21:14:02 +00:00
|
|
|
provider :linked_in_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
|
2012-04-18 11:26:59 +00:00
|
|
|
|
|
|
|
# google database connect
|
2017-01-10 21:14:02 +00:00
|
|
|
provider :google_oauth2_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database', {
|
|
|
|
authorize_options: {
|
2018-12-19 17:31:51 +00:00
|
|
|
access_type: 'online',
|
2017-01-10 21:14:02 +00:00
|
|
|
approval_prompt: '',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# github database connect
|
|
|
|
provider :github_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
|
|
|
|
|
|
|
|
# gitlab database connect
|
2021-03-10 16:11:14 +00:00
|
|
|
provider :git_lab_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database', {
|
2017-01-10 21:14:02 +00:00
|
|
|
client_options: {
|
2018-12-19 17:31:51 +00:00
|
|
|
site: 'https://not_change_will_be_set_by_database',
|
2017-01-10 21:14:02 +00:00
|
|
|
authorize_url: '/oauth/authorize',
|
2018-12-19 17:31:51 +00:00
|
|
|
token_url: '/oauth/token'
|
2017-01-10 21:14:02 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2017-07-14 06:15:14 +00:00
|
|
|
# microsoft_office365 database connect
|
|
|
|
provider :microsoft_office365_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
|
|
|
|
|
2017-09-26 14:41:55 +00:00
|
|
|
# weibo database connect
|
2017-09-30 08:21:16 +00:00
|
|
|
provider :weibo_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
|
2017-09-26 14:41:55 +00:00
|
|
|
|
2019-09-16 13:03:21 +00:00
|
|
|
# SAML database connect
|
|
|
|
provider :saml_database
|
2012-04-18 07:40:37 +00:00
|
|
|
end
|
2018-04-20 09:18:31 +00:00
|
|
|
|
|
|
|
# This fixes issue #1642 and is required for setups in which Zammad is used
|
|
|
|
# with a reverse proxy (like e.g. NGINX) handling the HTTPS stuff.
|
|
|
|
# This leads to the generation of a wrong redirect_uri because Rack detects a
|
|
|
|
# HTTP request which breaks OAuth2.
|
|
|
|
OmniAuth.config.full_host = proc {
|
|
|
|
"#{Setting.get('http_type')}://#{Setting.get('fqdn')}"
|
|
|
|
}
|
2020-01-08 11:06:21 +00:00
|
|
|
|
|
|
|
OmniAuth.config.logger = Rails.logger
|