Class: OmniAuth::Strategies::Unipass

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

Constant Summary collapse

DEFAULT_SCOPE =
'email'

Instance Method Summary collapse

Instance Method Details

#access_token_optionsObject



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

def access_token_options
  options.access_token_options.inject({}){ |h,(k,v)| h[k.to_sym] = v; h }
end

#authorize_paramsObject



52
53
54
55
56
57
58
# File 'lib/omniauth/strategies/unipass.rb', line 52

def authorize_params
  super.tap do |params|
    params.merge!(:display => request.params['display']) if request.params['display']
    params.merge!(:state   => request.params['state'])   if request.params['state']
    params[:scope] ||= DEFAULT_SCOPE
  end
end

#callback_urlObject



44
45
46
47
48
49
50
# File 'lib/omniauth/strategies/unipass.rb', line 44

def callback_url
  if options.authorize_options.respond_to?(:callback_url)
    options.authorize_options.callback_url
  else
    super
  end
end

#raw_infoObject



40
41
42
# File 'lib/omniauth/strategies/unipass.rb', line 40

def raw_info
  @raw_info ||= access_token.get("#{options[:client_options][:api_site]}/me").parsed
end