public AuthenticationContext(IConsumerCredentials consumerCredentials)
 {
     Token = new AuthenticationToken();
     Token.ConsumerCredentials = consumerCredentials.Clone();
 }
Beispiel #2
0
        /// <summary>
        /// Get the credentials from a PIN CODE/OAUTH VERIFIER provided by twitter.com to the user.
        /// 
        /// This method generates the credentials from the ConsumerCredentials used to get the Authentication URL.
        /// </summary>
        /// <param name="verifierCode">
        /// - PIN CODE Authentication : User enters the pin given on twitter.com
        /// - URL REDIRECT : Use the value of the 'oauth_verifier' url parameter.
        /// </param>
        /// <param name="authorizationKey">Authorization Key of the same credentials as the one given as a parameter to get the Authentication URL.</param>
        /// <param name="authorizationSecret">Authorization Secret of the same credentials as the one given as a parameter to get the Authentication URL.</param>
        /// <param name="consumerKey">Consumer Key of the same credentials as the one given as a parameter to get the Authentication URL.</param>
        /// <param name="consumerSecret">Consumer Secret of the same credentials as the one given as a parameter to get the Authentication URL.</param>
        public static ITwitterCredentials CreateCredentialsFromVerifierCode(
            string verifierCode,
            string authorizationKey,
            string authorizationSecret,
            string consumerKey,
            string consumerSecret)
        {
            var authToken = new AuthenticationToken
            {
                ConsumerCredentials = new ConsumerCredentials(consumerKey, consumerSecret),
                AuthorizationKey = authorizationKey,
                AuthorizationSecret = authorizationSecret
            };

            return _authFactory.GetCredentialsFromVerifierCode(verifierCode, authToken);
        }