views:

32

answers:

1

Anyone have code samples accessing Google Latitude with DotNetOpenAuth?

Getting an inner exception at consumer.PrepareAuthorizedRequest

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

A: 

It looks like you simply are not storing the consumer or token secret in your token manager. I see that you're using the InMemoryTokenManager, which is for samples only, since it doesn't persistently store these secrets.

Even if you're using the InMemoryTokenManager, be sure to preprogram the instance that the GoogleConsumer is using with your consumer key, consumer secret, and tokens and secrets in order for this method to not throw an exception.

Andrew Arnott