Class: OmniAuth::InstagramGraph::LongLivedClient

Inherits:
OAuth2::Client
  • Object
show all
Defined in:
lib/omniauth/instagram-graph/long_lived_client.rb

Constant Summary collapse

TOKEN_URL =
'/access_token'

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of LongLivedClient.


8
9
10
11
12
13
14
15
16
17
# File 'lib/omniauth/instagram-graph/long_lived_client.rb', line 8

def initialize(client_id, client_secret, options = {})
  options = {
    site: 'https://graph.instagram.com',
    authorize_url: nil,
    token_url: TOKEN_URL,
    token_method: :get,
  }.merge!(options)

  super(client_id, client_secret, options)
end

Instance Method Details

#get_token(params = {}) ⇒ Object


19
20
21
22
# File 'lib/omniauth/instagram-graph/long_lived_client.rb', line 19

def get_token(params = {})
  params = {grant_type: 'ig_exchange_token', client_secret: secret}.merge!(params)
  super(params, {}, LongLivedToken)
end