GRN2-xx: Added option to specify different redirect url for google auth (#1016)

* Added option to specify different redirect url for google auth

* Made the redirect url generic so it works with 365

Co-authored-by: Jesus Federico <jesus@123it.ca>
This commit is contained in:
Ahmad Farhat 2020-03-18 16:26:45 -04:00 committed by GitHub
parent 6bb831fb27
commit 3e7fb7ecc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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.