omniauth.rb 2.2 KB

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