1

I have a method that sends messages to friends, as follows:

   public virtual void SendMessage(Identity identity)
    {

        var authent = new MvcAuthorizer
        {
            Credentials = new SessionStateCredentials()
            {
                ConsumerKey = ConsumerKey,
                ConsumerSecret = ConsumerSecret,
                OAuthToken = identity.Token.Token,
                AccessToken = identity.Token.Secret
            }
        };

      ....
}

when I debug this method the token and key take their value, yet Auth value is null

I am sorry for my bad English, Thanks,

Victor
  • 235
  • 1
  • 5
  • 14
  • 1
    answer: Credentials = new InMemoryCredentials() – Victor Jun 19 '12 at 09:54
  • can you please explain us the différence between InMemoryCredentials and SessionStateCredentials !! – ucef Oct 22 '12 at 17:05
  • @ucef InMemoryCredentials is just an object with properties in memory with lifetime as the scope of the instance. SessionStateCredentials stores credentials in ASP.NET Session state, with lifetime tied to the user's session. A common problem occurs when session state is configured InProc because you can lose session state unpredictably. This problem is overcome by configuring session state to use a state server or SQL Server. LINQ to Twitter ITwitterAuthorizer Credentials properties are type ICredentials, meaning that anyone can create their own ICredentials type for custom persistence. – Joe Mayo Feb 19 '13 at 18:10

0 Answers0