Esempio n. 1
0
        private IConsumerTokenManager GetTokenManager()
        {
            var store = System.Web.HttpContext.Current.Session;
                var tokenManager = (InMemoryTokenManager)store["TwitterShortTermUserSessionTokenManager"];
                if (tokenManager == null)
                {
                    string consumerKey = ConfigurationManager.AppSettings["twitterConsumerKey"];
                    string consumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"];

                    tokenManager = new InMemoryTokenManager(consumerKey, consumerSecret);
                    store["TwitterShortTermUserSessionTokenManager"] = tokenManager;
                }

                return tokenManager;
        }
Esempio n. 2
0
        private IConsumerTokenManager GetTokenManager()
        {
            var store        = System.Web.HttpContext.Current.Session;
            var tokenManager = (InMemoryTokenManager)store["TwitterShortTermUserSessionTokenManager"];

            if (tokenManager == null)
            {
                string consumerKey    = ConfigurationManager.AppSettings["twitterConsumerKey"];
                string consumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"];

                tokenManager = new InMemoryTokenManager(consumerKey, consumerSecret);
                store["TwitterShortTermUserSessionTokenManager"] = tokenManager;
            }


            return(tokenManager);
        }