Esempio n. 1
0
        /// <summary>
        /// Get the users access token
        /// </summary>
        /// <param name="requestToken"></param>
        /// <param name="requestTokenSecret"></param>
        /// <param name="verificationCode"></param>
        /// <returns></returns>
        public async Task <AccessTokenInfo> GetAccessToken(string requestToken, string requestTokenSecret, string verificationCode)
        {
            // Set up the basic config parameters
            var config = new TinyOAuthConfig
            {
                AccessTokenUrl    = AccessTokenUrl,
                AuthorizeTokenUrl = AuthorizeTokenUrl,
                RequestTokenUrl   = TokenUrl,
                ConsumerKey       = ApiCredentials.ConsumerKey,
                ConsumerSecret    = ApiCredentials.ConsumerSecret
            };

            var tinyOAuth = new TinyOAuth(config);

            return(await tinyOAuth.GetAccessTokenAsync(requestToken, requestTokenSecret, verificationCode));
        }
Esempio n. 2
0
        public async Task <AccessTokenInfo> FinalizeAuthorizationAsync()
        {
            var accessTokenInfo = await _tinyOAuth.GetAccessTokenAsync(_requestTokenInfo.RequestToken, _requestTokenInfo.RequestTokenSecret, "");

            return(accessTokenInfo);
        }