Method: FbGraph::Auth#initialize

Defined in:
lib/fb_graph/auth.rb

#initialize(client_id, client_secret, options = {}) ⇒ Auth

Returns a new instance of Auth.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fb_graph/auth.rb', line 7

def initialize(client_id, client_secret, options = {})
  @client = Rack::OAuth2::Client.new(
    :identifier             => client_id,
    :secret                 => client_secret,
    :host                   => URI.parse(ROOT_URL).host,
    :authorization_endpoint => '/oauth/authorize',
    :token_endpoint         => '/oauth/access_token'
  )
  if options[:cookie]
    from_cookie options[:cookie]
  elsif options[:signed_request]
    from_signed_request options[:signed_request]
  end
end