//Add the Credentials from the App.config to the Windows Credential Manager private void AddCredentials() { var credentialToolBox = new WindowsCredentialToolBox(); try { var credentialConfig = _provideConfiguration.GetConfiguration <CredentialConfigSection>("credentialSection"); if (credentialConfig != null && credentialConfig.Credentials.Count > 0) { foreach (CredentialConfig credential in credentialConfig.Credentials) { credentialToolBox.Add(credential.Target, credential.User, credential.Password.DecodePassword(), credential.Type, credential.Persist); } } else { Logger.Info("No Credentials available"); } } catch (Exception e) { Logger.Error("Something wrong with the credentialSection in the App.config", e); } }
public void Teardown() { _windowsCredentialToolBox = null; }
public void Setup() { _windowsCredentialToolBox = new WindowsCredentialToolBox(); }