Exemple #1
0
        /// <summary>
        /// An async method to get auth tokens using refresh token.
        /// </summary>
        public static Task <LiveLoginResult> RefreshTokenAsync(
            string clientId, string clientSecret, string redirectUrl, string refreshToken,
            IEnumerable <string> scopes)
        {
            Debug.Assert(!string.IsNullOrEmpty(clientId));
            Debug.Assert(!string.IsNullOrEmpty(redirectUrl));
            Debug.Assert(!string.IsNullOrEmpty(refreshToken));

            string postContent = LiveAuthUtility.BuildRefreshTokenPostContent(clientId, clientSecret, redirectUrl, refreshToken, scopes);

            return(RequestAccessTokenAsync(postContent));
        }