Class: OmniAuth::Strategies::REINZ

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/reinz.rb

Constant Summary collapse

STAGING_URL =
'https://reinztestorg.b2clogin.com/reinztestorg.onmicrosoft.com/b2c_1a_csi_signup_signin/'.freeze
PRODUCTION_URL =
'https://login.reinz.co.nz/reinzorg.onmicrosoft.com/b2c_1a_csi_signup_signin/'.freeze

Instance Method Summary collapse

Instance Method Details

#callback_urlObject



38
39
40
# File 'lib/omniauth/strategies/reinz.rb', line 38

def callback_url
  options[:redirect_uri] || (full_host + script_name + callback_path)
end

#clientObject

Overrride client to merge in site based on sandbox option



22
23
24
25
26
27
28
# File 'lib/omniauth/strategies/reinz.rb', line 22

def client
  ::OAuth2::Client.new(
    options.client_id,
    options.client_secret,
    deep_symbolize(options.client_options).merge(site: site)
  )
end

#request_phaseObject



30
31
32
33
34
35
36
# File 'lib/omniauth/strategies/reinz.rb', line 30

def request_phase
  request_params = {
    redirect_uri: callback_url,
  }.merge(authorize_params)

  redirect client.implicit.authorize_url(request_params)
end