Class: OmniAuth::Strategies::Avaza

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

Overview

Strategy for Avaza

Constant Summary collapse

DEFAULT_SCOPE =
'read_users'

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/omniauth/strategies/avaza.rb', line 50

def authorize_params
  super.tap do |params|
    %w[scope state].each do |value|
      next unless request.params[value]

      params[value.to_sym] = request.params[value]

      session['omniauth.state'] = params[:state] if value == 'state'
    end

    params[:scope] ||= DEFAULT_SCOPE
  end
end

#callback_urlObject



42
43
44
# File 'lib/omniauth/strategies/avaza.rb', line 42

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

#raw_infoObject



46
47
48
# File 'lib/omniauth/strategies/avaza.rb', line 46

def raw_info
  @raw_info ||= access_token.get().parsed['users'].first
end