2017-07-13 15:08:53 +00:00
|
|
|
class MicrosoftOffice365Database < OmniAuth::Strategies::MicrosoftOffice365
|
|
|
|
option :name, 'microsoft_office365'
|
|
|
|
|
|
|
|
def initialize(app, *args, &block)
|
|
|
|
|
|
|
|
# database lookup
|
|
|
|
config = Setting.get('auth_microsoft_office365_credentials') || {}
|
|
|
|
args[0] = config['app_id']
|
|
|
|
args[1] = config['app_secret']
|
2021-03-08 13:13:15 +00:00
|
|
|
tenant = config['app_tenant'].presence || 'common'
|
|
|
|
|
2017-07-13 15:08:53 +00:00
|
|
|
super
|
2021-03-08 13:13:15 +00:00
|
|
|
|
|
|
|
@options[:client_options][:authorize_url] = "/#{tenant}/oauth2/v2.0/authorize"
|
|
|
|
@options[:client_options][:token_url] = "/#{tenant}/oauth2/v2.0/token"
|
2017-07-13 15:08:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|