forked from External/greenlight
GRN2-107: Add office365 auth (#616)
* add office365 auth * Delete conflicting file
This commit is contained in:
committed by
Jesus Federico
parent
40b05b1626
commit
fc18976b6d
@ -78,17 +78,23 @@ module SessionsHelper
|
||||
end
|
||||
|
||||
def omniauth_options(env)
|
||||
gl_redirect_url = (Rails.env.production? ? "https" : env["rack.url_scheme"]) + "://" + env["SERVER_NAME"] + ":" +
|
||||
env["SERVER_PORT"]
|
||||
user_domain = parse_user_domain(env["SERVER_NAME"])
|
||||
env['omniauth.strategy'].options[:customer] = user_domain
|
||||
env['omniauth.strategy'].options[:gl_redirect_url] = gl_redirect_url
|
||||
env['omniauth.strategy'].options[:default_callback_url] = Rails.configuration.gl_callback_url
|
||||
env['omniauth.strategy'].options[:checksum] = generate_checksum(user_domain, gl_redirect_url,
|
||||
Rails.configuration.launcher_secret)
|
||||
if env['omniauth.strategy'].options[:name] == "bn-launcher"
|
||||
gl_redirect_url = (Rails.env.production? ? "https" : env["rack.url_scheme"]) + "://" + env["SERVER_NAME"] + ":" +
|
||||
env["SERVER_PORT"]
|
||||
user_domain = parse_user_domain(env["SERVER_NAME"])
|
||||
env['omniauth.strategy'].options[:customer] = user_domain
|
||||
env['omniauth.strategy'].options[:gl_redirect_url] = gl_redirect_url
|
||||
env['omniauth.strategy'].options[:default_callback_url] = Rails.configuration.gl_callback_url
|
||||
env['omniauth.strategy'].options[:checksum] = generate_checksum(user_domain, gl_redirect_url,
|
||||
Rails.configuration.launcher_secret)
|
||||
elsif env['omniauth.strategy'].options[:name] == "google"
|
||||
set_hd(env, ENV['GOOGLE_OAUTH2_HD'])
|
||||
elsif env['omniauth.strategy'].options[:name] == "office365"
|
||||
set_hd(env, ENV['OFFICE365_HD'])
|
||||
end
|
||||
end
|
||||
|
||||
def google_omniauth_hd(env, hd)
|
||||
def set_hd(env, hd)
|
||||
hd_opts = hd.split(',')
|
||||
env['omniauth.strategy'].options[:hd] =
|
||||
if hd_opts.empty?
|
||||
|
Reference in New Issue
Block a user