microsoft_office365_database.rb 631 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class MicrosoftOffice365Database < OmniAuth::Strategies::MicrosoftOffice365
  3. option :name, 'microsoft_office365'
  4. def initialize(app, *args, &block)
  5. # database lookup
  6. config = Setting.get('auth_microsoft_office365_credentials') || {}
  7. args[0] = config['app_id']
  8. args[1] = config['app_secret']
  9. tenant = config['app_tenant'].presence || 'common'
  10. super
  11. @options[:client_options][:authorize_url] = "/#{tenant}/oauth2/v2.0/authorize"
  12. @options[:client_options][:token_url] = "/#{tenant}/oauth2/v2.0/token"
  13. end
  14. end