예제 #1
0
        private static async Task <Auth> _InteractiveLoginUrl(IAuthenticationClient authClient)
        {
            string url       = authClient.OAuthUrl();
            string?oauthCode = null;

            while (true)
            {
                Console.WriteLine($"Login with this url : {url}");
                Console.Write("paste authorization token here :");

                oauthCode = Console.ReadLine()?.Trim();
                if (string.IsNullOrEmpty(oauthCode))
                {
                    Console.WriteLine("You entered empty string");
                    continue;
                }

                break;
            }

            Auth auth = await authClient.ConnectWithCode(oauthCode);

            return(auth);
        }