class OmniAuth::Strategies::MVC

Public Instance Methods

access_token_options() click to toggle source
# File lib/omniauth/strategies/mvc.rb, line 80
def access_token_options
  options.access_token_options.inject({}) { |h,(k,v)| h[k.to_sym] = v; h }
end
appsecret_proof() click to toggle source
# File lib/omniauth/strategies/mvc.rb, line 98
def appsecret_proof
  @appsecret_proof ||= OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA256.new, client.secret, access_token.token)
end
authorize_params() click to toggle source

You can pass display, scope, or auth_type params to the auth request, if you need to set them dynamically. You can also set these options in the OmniAuth config :authorize_params option.

For example: /auth/facebook?display=popup

Calls superclass method
# File lib/omniauth/strategies/mvc.rb, line 88
def authorize_params
  super.tap do |params|
    %w[display scope auth_type].each do |v|
      if request.params[v]
        params[v.to_sym] = request.params[v]
      end
    end
  end
end
callback_url() click to toggle source
# File lib/omniauth/strategies/mvc.rb, line 71
def callback_url
  if @authorization_code_from_signed_request_in_cookie
    ''
  else
    # Fixes regression in omniauth-oauth2 v1.4.0 by https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7
    options[:callback_url] || (full_host + script_name + callback_path)
  end
end
info_options() click to toggle source
# File lib/omniauth/strategies/mvc.rb, line 39
def info_options
  params = {:appsecret_proof => appsecret_proof}
  params.merge!({:fields => (options[:info_fields] || 'name,email')})
  params.merge!({:locale => options[:locale]}) if options[:locale]

  { :params => params }
end
old_request_phase()
Alias for: request_phase
raw_info() click to toggle source
# File lib/omniauth/strategies/mvc.rb, line 33
def raw_info
  @raw_info ||= access_token.get('api/me', info_options).parsed || {}
rescue ::Errno::ETIMEDOUT
  raise ::Timeout::Error
end
request_phase() click to toggle source
# File lib/omniauth/strategies/mvc.rb, line 49
def request_phase
  %w[force_login lang screen_name].each do |v|
    if request.params[v]
      options[:authorize_params][v.to_sym] = request.params[v]
    end
  end

  %w[x_auth_access_type].each do |v|
    if request.params[v]
      options[:request_params][v.to_sym] = request.params[v]
    end
  end

  if options[:use_authorize] || request.params['use_authorize'] == 'true'
    options[:client_options][:authorize_path] = '/oauth/authorize'
  else
    options[:client_options][:authorize_path] = '/oauth/authenticate'
  end

  old_request_phase
end
Also aliased as: old_request_phase