0
我試圖使用Rack + omniauth在eBay上進行身份驗證(實際上是 - omniauth-ebay)。我有一個正確配置(而不是 「111」, 「222」 ......有實值):如何調試Omniauth和Rack應用程序?
#config.rb
use OmniAuth::Builder do
provider :ebay, "111", "222", "333", "4444", "0", "https://api.sandbox.ebay.com/wsapi"
end
當我去到L ocalhost:9292/auth/ebay
,我收到的錯誤:
NoMethodError at /auth/ebay
undefined method `[]' for nil:NilClass
file: ebay_api.rb location: generate_session_id line: 21
#....
omniauth.error - <NoMethodError: undefined method `[]' for nil:NilClass>
omniauth.error.strategy - #<OmniAuth::Strategies::Ebay>
omniauth.error.type - "Failed to retrieve session id from ebay"
omniauth.strategy - <OmniAuth::Strategies::Ebay>
我想知道的是如何調試?特別是localhost:9292/auth/ebay
的路徑,因爲我沒有在我的應用程序中定義它,因爲Omniauth 會自動嵌入。
您的想法?
沒錯,網址現在是正確的。但我使用最新版本,我只是安裝它。 –
但現在它將我重定向到https://signin.ebay.com/ws/eBayISAPI.dll的生產登錄網址。如何讓它使用沙箱網址 - https://signin.sandbox.ebay.com/ws/eBayISAPI.dll? –
不幸的是,這個值在[ebay_api.rb](https://github.com/TheGiftsProject/omniauth-ebay/blob/master/lib/ebay_api.rb)中被硬編碼。您可以在本地更改此設置'EBAY_LOGIN_URL' – 2012-10-28 18:18:13