Sha256: 4d097ac0edb8cd6834c772a4212ff573124e34d9129e7e71786c1a6f93dc5fdc

Contents?: true

Size: 705 Bytes

Versions: 4

Compression:

Stored size: 705 Bytes

Contents

class ExvoAuth::Strategies::NonInteractive < ExvoAuth::Strategies::Base
  def initialize(app, app_id, app_secret, options = {})
    super(app, :non_interactive, app_id, app_secret, options)
  end
  
  def request_phase(options = {})
    redirect @client.non_interactive.authorize_url(:redirect_uri => callback_url, :scope => request["scope"])
  end
  
  def callback_url
    key   = ExvoAuth::Config.callback_key
    value = request[key]
    
    if value
      super + "?" + Rack::Utils.build_query(key => value)
    else
      super
    end
  end
  
  def fail!(message_key)
    [401, { "Content-Type" => "application/json" }, [MultiJson.encode(:message => "Not signed in!", :status => 401)]]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
exvo-auth-0.2.0 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.1.7 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.1.6 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.1.5 lib/exvo_auth/strategies/non_interactive.rb