2012-08-28 55 views
0

我正在使用Ruby Gem「databascdotcom」將Salesforce集成到Rails應用程序中,並且所有工作都正常,直到我使用沙箱帳戶類型「Configuration Only」進行嘗試。在rails中的salesforce沙盒集成,錯誤過期的訪問

以下代碼在與salesforce產品帳戶一起使用時工作正常。 這裏是我的代碼

def SalesForceFeed 
    @oppID = params[:oppid] 

    client = Databasedotcom::Client.new client.client_id #=> foo client.client_secret #=> bar 
    client.authenticate :username => "[email protected]", :password => "ThePasswordTheSecurityToken" #=> "the-oauth-token" 
    client.materialize("Opportunity") 
    begin 
     @client=SalesForce::Connection.new.client 
     @opp = Opportunity.find_by_Id(@oppID) 
    rescue Exception=>e 
end 

但是當我嘗試使用用戶名與Salesforce沙箱帳戶使用它像「[email protected]」 我m到處以下錯誤「過期的訪問/刷新令牌」

任何想法?

回答

0

得到了問題。

只需要添加

主機= 「test.salesforce.com」

感謝所有