forked from External/greenlight
* <Added omniauth for office365> * <Fixed code style> * Update puma.rb * <Inserted link to documentation>
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# List of supported Omniauth providers.
|
||||
Rails.application.config.providers = [:google, :twitter, :ldap]
|
||||
Rails.application.config.providers = [:google, :twitter, :microsoft_office365, :ldap]
|
||||
|
||||
# Set which providers are configured.
|
||||
Rails.application.config.omniauth_google = ENV['GOOGLE_OAUTH2_ID'].present? && ENV['GOOGLE_OAUTH2_SECRET'].present?
|
||||
Rails.application.config.omniauth_twitter = ENV['TWITTER_ID'].present? && ENV['TWITTER_SECRET'].present?
|
||||
Rails.application.config.omniauth_microsoft_office365 = ENV['OFFICE365_KEY'].present? &&
|
||||
ENV['OFFICE365_SECRET'].present?
|
||||
Rails.application.config.omniauth_ldap = ENV['LDAP_SERVER'].present? && ENV['LDAP_UID'].present? &&
|
||||
ENV['LDAP_BASE'].present? && ENV['LDAP_BIND_DN'].present? &&
|
||||
ENV['LDAP_PASSWORD'].present?
|
||||
@ -35,6 +37,8 @@ Rails.application.config.middleware.use OmniAuth::Builder do
|
||||
name: 'google',
|
||||
hd: ENV['GOOGLE_OAUTH2_HD'].blank? ? nil : ENV['GOOGLE_OAUTH2_HD']
|
||||
|
||||
provider :microsoft_office365, ENV['OFFICE365_KEY'], ENV['OFFICE365_SECRET']
|
||||
|
||||
provider :ldap,
|
||||
host: ENV['LDAP_SERVER'],
|
||||
port: ENV['LDAP_PORT'] || '389',
|
||||
|
Reference in New Issue
Block a user