Beispiel #1
0
        public void StoreCredentialsForHostToVariable(string host, AuthType authType, string domain, string username, string password, string varName)
        {
            var credentialCache   = new CredentialCache();
            var networkCredential = new NetworkCredential(username, new Encryptor().Decrypt(password), domain);

            credentialCache.Add(new Uri(host), authType.ToString(), networkCredential);
            this.variableContext.SetVariable(varName, credentialCache.GetType(), credentialCache);
        }
        public void StoreCredentialsForHostToVariable(string host, AuthType authType, string domain, string username, string password, string varName)
        {
            this.variableController.Variables.Should().NotContainKey(varName, $"переменная \"{varName}\" уже существует");
            var credentialCache   = new CredentialCache();
            var networkCredential = new NetworkCredential(username, Encryptor.Decrypt(password), domain);

            credentialCache.Add(new Uri(host), authType.ToString(), networkCredential);
            this.variableController.SetVariable(varName, credentialCache.GetType(), credentialCache);
        }