lib/gooddata/client.rb in gooddata-0.5.11 vs lib/gooddata/client.rb in gooddata-0.5.12

- old
+ new

@@ -86,9 +86,25 @@ # def connect(user, password, url = nil, options={}) threaded[:connection] = Connection.new user, password, url, options end + # This method is aimed at creating an authenticated connection in case you do not hae pass/login but you have SST + # === Parameters + # + # * +options+ - :server => optional GD server uri. If nil it secure will be used + # * +options+ - :cookies => you can specify a hash of cookies + # + def create_authenticated_connection(options={}) + url = options[:server] + + connect("", "", url, options) + server_cookies = options[:cookies] + connection.merge_cookies!(server_cookies) + connection.status = :logged_in + connection + end + # Returns the active GoodData connection earlier initialized via # GoodData.connect call # # @see GoodData.connect #