Sha256: 64a5f2b9c46d49c25635f614cb8d318e6806fa3088741816f487a7f71a56298b

Contents?: true

Size: 763 Bytes

Versions: 8

Compression:

Stored size: 763 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)
    body = MultiJson.encode(:error => "Please sign in!")
    [401, { 
      "Content-Type"   => "application/json", 
      "Content-Length" => body.length.to_s 
    }, [body]]
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
exvo-auth-0.4.0 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.3.4 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.3.3 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.3.2 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.3.1 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.3.0 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.2.2 lib/exvo_auth/strategies/non_interactive.rb
exvo-auth-0.2.1 lib/exvo_auth/strategies/non_interactive.rb