omniauth.rb 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. # SAML database connect
  43. provider :saml_database
  44. end
  45. # This fixes issue #1642 and is required for setups in which Zammad is used
  46. # with a reverse proxy (like e.g. NGINX) handling the HTTPS stuff.
  47. # This leads to the generation of a wrong redirect_uri because Rack detects a
  48. # HTTP request which breaks OAuth2.
  49. OmniAuth.config.full_host = proc {
  50. "#{Setting.get('http_type')}://#{Setting.get('fqdn')}"
  51. }