Class: OmniAuth::InstagramGraph::LongLivedClient
- Inherits:
-
OAuth2::Client
- Object
- OAuth2::Client
- OmniAuth::InstagramGraph::LongLivedClient
- Defined in:
- lib/omniauth/instagram-graph/long_lived_client.rb
Constant Summary collapse
- TOKEN_URL =
'/access_token'
Instance Method Summary collapse
- #get_token(params = {}) ⇒ Object
-
#initialize(client_id, client_secret, options = {}) ⇒ LongLivedClient
constructor
A new instance of LongLivedClient.
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, = {}) = { site: 'https://graph.instagram.com', authorize_url: nil, token_url: TOKEN_URL, token_method: :get, }.merge!() super(client_id, client_secret, ) 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 |