diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 2f4b4f6b..0edb9b67 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -46,12 +46,14 @@ Rails.application.config.middleware.use OmniAuth::Builder do scope: %w(profile email), access_type: 'online', name: 'google', + redirect_uri: ENV['OAUTH2_REDIRECT'].presence || nil, setup: SETUP_PROC end if Rails.configuration.omniauth_office365 Rails.application.config.providers << :office365 provider :office365, ENV['OFFICE365_KEY'], ENV['OFFICE365_SECRET'], + redirect_uri: ENV['OAUTH2_REDIRECT'].presence || nil, setup: SETUP_PROC end end diff --git a/sample.env b/sample.env index ca870e80..6e6496fc 100644 --- a/sample.env +++ b/sample.env @@ -44,6 +44,10 @@ OFFICE365_KEY= OFFICE365_SECRET= OFFICE365_HD= +# OAUTH2_REDIRECT allows you to specify the redirect_url passed to oauth on sign in. +# It is useful for cases when Greenlight is deployed behind a Network Load Balancer or proxy +OAUTH2_REDIRECT= + # LDAP Login Provider (optional) # # You can enable LDAP authentication by providing values for the variables below.