omniauth.rb 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. Rails.application.config.middleware.use OmniAuth::Builder do
  3. # twitter database connect
  4. provider :twitter_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database', {
  5. client_options: {
  6. authorize_path: '/oauth/authorize',
  7. site: 'https://api.twitter.com',
  8. }
  9. }
  10. # facebook database connect
  11. provider :facebook_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
  12. # linkedin database connect
  13. provider :linked_in_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
  14. # google database connect
  15. provider :google_oauth2_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database', access_type: 'online', prompt: ''
  16. # github database connect
  17. provider :github_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
  18. # gitlab database connect
  19. provider :git_lab_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database', {
  20. client_options: {
  21. site: 'https://not_change_will_be_set_by_database',
  22. authorize_url: '/oauth/authorize',
  23. token_url: '/oauth/token'
  24. },
  25. scope: 'read_user',
  26. }
  27. # microsoft_office365 database connect
  28. provider :microsoft_office365_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
  29. # weibo database connect
  30. provider :weibo_database, 'not_change_will_be_set_by_database', 'not_change_will_be_set_by_database'
  31. # SAML database connect
  32. provider :saml_database
  33. provider :oidc_database
  34. end
  35. # This fixes issue #1642 and is required for setups in which Zammad is used
  36. # with a reverse proxy (like e.g. NGINX) handling the HTTPS stuff.
  37. # This leads to the generation of a wrong redirect_uri because Rack detects a
  38. # HTTP request which breaks OAuth2.
  39. OmniAuth.config.full_host = proc {
  40. "#{Setting.get('http_type')}://#{Setting.get('fqdn')}"
  41. }
  42. OmniAuth.config.logger = Rails.logger