Sha256: c8222bb839812cb38f15bff279b4e213cdab679028b625cc92d780079bafc1ea

Contents?: true

Size: 575 Bytes

Versions: 1

Compression:

Stored size: 575 Bytes

Contents

module Omniauth
  module InstagramGraph
  	class LongLivedClient < OAuth2::Client
  		TOKEN_URL = '/access_token'

  		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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-instagram-graph-1.0.0 lib/omniauth/instagram-graph/long_lived_client.rb