Class: FacebookTestUsers::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/facebook_test_users/access_token.rb

Constant Summary collapse

OAUTH_BASE =
'https://graph.facebook.com/oauth/access_token'

Class Method Summary collapse

Class Method Details

.get(app_id, app_secret, oauth_base = OAUTH_BASE) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/facebook_test_users/access_token.rb', line 11

def self.get(app_id, app_secret, oauth_base=OAUTH_BASE)
   response = RestClient.get(
     oauth_base,
     :params => {
       'client_id'     => app_id,
       'client_secret' => app_secret,
       'grant_type'    => 'client_credentials'   # FB magic string
     })

   extract_access_token(response)
end