Class: OmniAuth::Strategies::Instagram
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Instagram
- Defined in:
- lib/omniauth/strategies/instagram.rb
Constant Summary collapse
- DEFAULT_SCOPE =
"instagram_business_basic"- DEFAULT_FIELDS =
"user_id,username,name,account_type,profile_picture_url,followers_count,follows_count,media_count"
Instance Method Summary collapse
Instance Method Details
#callback_url ⇒ Object
46 47 48 |
# File 'lib/omniauth/strategies/instagram.rb', line 46 def callback_url full_host + callback_path end |
#long_lived_token ⇒ Object
54 55 56 |
# File 'lib/omniauth/strategies/instagram.rb', line 54 def long_lived_token @long_lived_token ||= ::OAuth2::AccessToken.from_hash(client, access_token.get("/access_token", params: {grant_type: "ig_exchange_token", client_secret: .client_secret, access_token: access_token.token}).parsed) end |
#raw_info ⇒ Object
50 51 52 |
# File 'lib/omniauth/strategies/instagram.rb', line 50 def raw_info @raw_info ||= long_lived_token.get("/me", params: {fields: DEFAULT_FIELDS}).parsed end |
#token_params ⇒ Object
39 40 41 42 43 44 |
# File 'lib/omniauth/strategies/instagram.rb', line 39 def token_params super.tap do |params| params[:client_id] = .client_id params[:client_secret] = .client_secret end end |