public Credentials GetCredentials()
 {
     if (credentials == null)
     {
         string username = ConsolePrompt.Prompt("User");
         string password = ConsolePrompt.PromptSecret("Password");
         credentials = new Credentials(username, password);
     }
     return credentials;
 }
Пример #2
0
        public static Authorization GetAuthorization(ICredentialProvider credentialProvider)
        {
            Credentials.Credentials credentials = credentialProvider.GetCredentials();

            var authService = new AuthorizationService(credentials.Username, credentials.Password)
            {
                UserAgent    = Program.UserAgent,
                AgentVersion = Program.AgentVersion
            };

            return(GetAuthorization(authService));
        }
 private void CreateCredentials(IEnumerable<string> helperResponseLines)
 {
     Dictionary<string, string> results = ParseHelperLines(helperResponseLines);
     credentials = new Credentials(results["username"], results["password"]);
 }