microsoft_graph.rb 936 B

123456789101112131415161718192021222324252627282930313233
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. class ExternalCredential::MicrosoftGraph < ExternalCredential::MicrosoftBase
  3. def self.channel_area
  4. 'MicrosoftGraph::Account'.freeze
  5. end
  6. def self.error_missing_app_configuration
  7. __('No Microsoft Graph app configured!')
  8. end
  9. def self.authorize_scope
  10. 'offline_access openid profile email mail.readwrite mail.readwrite.shared mail.send mail.send.shared'
  11. end
  12. def self.channel_options_inbound(user_data, account_data)
  13. {
  14. adapter: 'microsoft_graph_inbound',
  15. options: {
  16. user: user_data[:preferred_username],
  17. }.merge(account_data[:shared_mailbox].present? ? { shared_mailbox: account_data[:shared_mailbox] } : {}),
  18. }
  19. end
  20. def self.channel_options_outbound(user_data)
  21. {
  22. adapter: 'microsoft_graph_outbound',
  23. options: {
  24. user: user_data[:preferred_username],
  25. }
  26. }
  27. end
  28. end