Class: OmniAuth::Strategies::Barong

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

Instance Method Summary collapse

Instance Method Details

#callback_urlObject



60
61
62
# File 'lib/omniauth/strategies/barong.rb', line 60

def callback_url
  options.callback_url || (full_host + script_name + callback_path)
end

#clientObject



27
28
29
30
31
32
# File 'lib/omniauth/strategies/barong.rb', line 27

def client
  options.client_options.site = domain_url
  options.client_options.authorize_url = options.authorize_url
  options.client_options.redirect_uri = callback_url
  super
end

#domain_urlObject



34
35
36
37
38
# File 'lib/omniauth/strategies/barong.rb', line 34

def domain_url
  domain_url = URI(options.domain)
  domain_url = URI("#{scheme}://#{domain_url}") unless domain_url.class.in? ([URI::HTTP, URI::HTTPS])
  domain_url.to_s
end

#raw_infoObject



52
53
54
# File 'lib/omniauth/strategies/barong.rb', line 52

def raw_info
  @raw_info ||= access_token.get(raw_info_url).parsed
end

#raw_info_urlObject



56
57
58
# File 'lib/omniauth/strategies/barong.rb', line 56

def raw_info_url
  options.raw_info_url || "/api/#{options.api_version}/accounts/me"
end