Sha256: 035db313acf5b66a076bcd260a91d95ba19f45fcea0646ffd1e858b9858d8f49

Contents?: true

Size: 744 Bytes

Versions: 14

Compression:

Stored size: 744 Bytes

Contents

module Instagram
  # Defines HTTP request methods
  module OAuth
    # Return URL for OAuth authorization
    def authorize_url(options={})
      options[:response_type] ||= "code"
      params = access_token_params.merge(options)
      connection.build_url("/oauth/authorize/", params).to_s
    end

    # Return an access token from authorization
    def get_access_token(code, options={})
      options[:grant_type] ||= "authorization_code"
      params = access_token_params.merge(options)
      post("/oauth/access_token/", params.merge(:code => code), raw=false, unformatted=true)
    end

    private

    def access_token_params
      {
        :client_id => client_id,
        :client_secret => client_secret
      }
    end
  end
end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
instagram_geo-0.8.8 lib/instagram/oauth.rb
instagram_geo-0.8.7 lib/instagram/oauth.rb
instagram-0.8.5 lib/instagram/oauth.rb
instagram-0.8.4 lib/instagram/oauth.rb
instagram-0.8.3 lib/instagram/oauth.rb
instagram-0.8.2 lib/instagram/oauth.rb
instagram-fixed-0.8.1 lib/instagram-fixed/oauth.rb
instagram-fixed-0.8 lib/instagram/oauth.rb
instagram-0.8 lib/instagram/oauth.rb
instagram-0.7 lib/instagram/oauth.rb
instagram-0.6.2 lib/instagram/oauth.rb
localist-instagvram-0.6.2 lib/instagram/oauth.rb
instagram-0.6.1 lib/instagram/oauth.rb
instagram-0.6 lib/instagram/oauth.rb