2010-08-12 51 views
0

任何人都有代碼示例訪問谷歌縱橫DotNetOpenAuth?尋找谷歌縱橫和DotNetOpenAuth的代碼示例

獲得一個內部異常在consumer.PrepareAuthorizedRequest

在System.ThrowHelper.ThrowKeyNotFoundException() 在System.Collections.Generic.Dictionary`2.get_Item(TKEY的鍵) 在DotNetOpenAuth.Samples.OAuthConsumerWpf .InMemoryTokenManager.GetTokenSecret(String token)in F:\ GoogleLatitude \ DotNetOpenAuth-3.4.5.10202 \ Samples \ OAuthConsumerWpf \ InMemoryTokenManager.cs:line 35 at c:\ Users中的DotNetOpenAuth.OAuth.ChannelElements.OAuthChannel.SignatureCallback(ITamperResistantProtocolMessage message) \ andarno \ git \ dotnetopenid \ src \ DotNetOpenAuth \ OAuth \ ChannelElements \ OAuthChannel.cs:line 401

回答

0

看起來你只是沒有在你的令牌管理器中存儲消費者或令牌密鑰。我發現你使用的是InMemoryTokenManager,僅適用於樣本,因爲它不會持久存儲這些祕密。

即使您使用的是InMemoryTokenManager,請務必預先編制GoogleConsumer正在使用的實例的消費者密鑰,使用者密碼以及令牌和機密,以便此方法不引發異常。