/// <summary> /// Initializes a new instance of the <see cref="LinkedInDataProvider"/> class. /// Constructor. /// </summary> /// <param name="tokens">OAuth tokens for request.</param> /// <param name="requiredPermissions">Required permissions for the session.</param> /// <param name="authentication">Authentication result interface.</param> /// <param name="passwordManager">Password Manager interface, store the password.</param> /// <param name="storageManager">Storage Manager interface.</param> public LinkedInDataProvider(LinkedInOAuthTokens tokens, LinkedInPermissions requiredPermissions, IAuthenticationBroker authentication, IPasswordManager passwordManager, IStorageManager storageManager) { if (string.IsNullOrEmpty(tokens.ClientSecret)) { throw new ArgumentException("Missing client secret key"); } if (string.IsNullOrEmpty(tokens.ClientId)) { throw new ArgumentException("Missing client ID"); } if (string.IsNullOrEmpty(tokens.CallbackUri)) { throw new ArgumentException("Missing callback uri"); } // Check if its a valid combination of LinkedInPermissions if ((~(int)LinkedInPermissionsHelpers.AllPermissions & (int)requiredPermissions) != 0) { throw new ArgumentException("Error retrieving required permissions"); } Tokens = tokens; RequiredPermissions = requiredPermissions; _authentication = authentication ?? throw new ArgumentException("Invalid AuthenticationBroker"); _storageManager = storageManager ?? throw new ArgumentException("Invalid StorageManager"); _passwordManager = passwordManager ?? throw new ArgumentException("Invalid PasswordManager"); }
public UserAuthenticator( EventManagerDbContext dbContext, IPasswordManager passwordManager) : base(dbContext) { this.passwordManager = passwordManager; }
public GetUser( IUnitOfWork unitOfWork, IPasswordManager passwordManager) { _unitOfWork = unitOfWork; _passwordManager = passwordManager; }
/// <summary> /// Initializes a new instance of the <see cref="WeiboDataProvider"/> class. /// Constructor. /// </summary> /// <param name="tokens">OAuth tokens for request.</param> /// <param name="authenticationBroker">Authentication result interface.</param> /// <param name="passwordManager">Platform password manager</param> /// <param name="storageManager">Platform storage provider</param> public WeiboDataProvider(WeiboOAuthTokens tokens, IAuthenticationBroker authenticationBroker, IPasswordManager passwordManager, IStorageManager storageManager) { if (string.IsNullOrEmpty(tokens.AppSecret)) { throw new ArgumentException("Missing app secret"); } if (string.IsNullOrEmpty(tokens.AppKey)) { throw new ArgumentException("Missing app key"); } if (string.IsNullOrEmpty(tokens.RedirectUri)) { throw new ArgumentException("Missing redirect uri"); } _tokens = tokens; _authenticationBroker = authenticationBroker ?? throw new ArgumentException("Invalid AuthenticationBroker"); _passwordManager = passwordManager ?? throw new ArgumentException("Invalid PasswordManager"); _storageManager = storageManager ?? throw new ArgumentException("Invalid StorageManager"); if (_client == null) { HttpClientHandler handler = new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip }; _client = new HttpClient(handler); } }
public AccountManager(AbstractRepository <Account> repository, IPasswordManager passwordManager) { _repository = repository; _passwordManager = passwordManager; ReadContext = repository; }
public UserManager( IUserRepository userRepository, IConfirmationService confirmationService, PaginationSettings paginationSettings, IProjectMembershipRepostiory projectMembershipRepostiory, IMailer mailer, ApplicationLocationSettings applicationLocationSettings, IPasswordManager passwordManager, IEventBus eventBus) { Require.NotNull(userRepository, nameof(userRepository)); Require.NotNull(confirmationService, nameof(confirmationService)); Require.NotNull(paginationSettings, nameof(paginationSettings)); Require.NotNull(projectMembershipRepostiory, nameof(projectMembershipRepostiory)); Require.NotNull(mailer, nameof(mailer)); Require.NotNull(applicationLocationSettings, nameof(applicationLocationSettings)); Require.NotNull(passwordManager, nameof(passwordManager)); Require.NotNull(eventBus, nameof(eventBus)); _userRepository = userRepository; _confirmationService = confirmationService; _paginationSettings = paginationSettings; _projectMembershipRepostiory = projectMembershipRepostiory; _mailer = mailer; _applicationLocationSettings = applicationLocationSettings; _passwordManager = passwordManager; _eventBus = eventBus; }
/// <summary> /// Initializes a new instance of the <see cref="LinkedInDataProvider"/> class. /// Constructor. /// </summary> /// <param name="tokens">OAuth tokens for request.</param> /// <param name="requiredPermissions">Required permissions for the session.</param> /// <param name="authentication">Authentication result interface.</param> /// <param name="passwordManager">Password Manager interface, store the password.</param> /// <param name="storageManager">Storage Manager interface.</param> public LinkedInDataProvider(LinkedInOAuthTokens tokens, LinkedInPermissions requiredPermissions, IAuthenticationBroker authentication, IPasswordManager passwordManager, IStorageManager storageManager) { if (string.IsNullOrEmpty(tokens.ClientSecret)) { throw new ArgumentException("Missing client secret key"); } if (string.IsNullOrEmpty(tokens.ClientId)) { throw new ArgumentException("Missing client ID"); } if (string.IsNullOrEmpty(tokens.CallbackUri)) { throw new ArgumentException("Missing callback uri"); } if (!Enum.IsDefined(typeof(LinkedInPermissions), requiredPermissions)) { throw new ArgumentException("Error retrieving required permissions"); } Tokens = tokens; RequiredPermissions = requiredPermissions; _authentication = authentication ?? throw new ArgumentException("Invalid AuthenticationBroker"); _storageManager = storageManager ?? throw new ArgumentException("Invalid StorageManager"); _passwordManager = passwordManager ?? throw new ArgumentException("Invalid PasswordManager"); }
/// <summary> /// Initializes a new instance of the <see cref="TwitterDataProvider"/> class. /// Constructor. /// </summary> /// <param name="tokens">OAuth tokens for request.</param> /// <param name="authenticationBroker">Authentication result interface.</param> /// <param name="passwordManager">Platform password manager</param> /// <param name="storageManager">Platform storage provider</param> /// <param name="signatureManager">Platform signature manager</param> public TwitterDataProvider(TwitterOAuthTokens tokens, IAuthenticationBroker authenticationBroker, IPasswordManager passwordManager, IStorageManager storageManager, ISignatureManager signatureManager) { if (string.IsNullOrEmpty(tokens.ConsumerSecret)) { throw new ArgumentException("Missing consumer secret"); } if (string.IsNullOrEmpty(tokens.ConsumerKey)) { throw new ArgumentException("Missing consumer key"); } if (string.IsNullOrEmpty(tokens.CallbackUri)) { throw new ArgumentException("Missing callback uri"); } _tokens = tokens; _authenticationBroker = authenticationBroker ?? throw new ArgumentException("Missing AuthenticationBroker"); _passwordManager = passwordManager ?? throw new ArgumentException("Missing PasswordManager"); _storageManager = storageManager ?? throw new ArgumentException("Missing StorageManager"); _signatureManager = signatureManager ?? throw new ArgumentException("Missing SignatureManager"); if (_client == null) { HttpClientHandler handler = new HttpClientHandler(); handler.AutomaticDecompression = DecompressionMethods.GZip; _client = new HttpClient(handler); } }
public void Setup() { clientService = new ClientService( userService = new UserService( userStore = new DictionaryUserSource())); userStore[SecurityConst.ROLE_ADMIN.ToLowerInvariant()] = new User { Login = SecurityConst.ROLE_ADMIN, IsAdmin = true }.Activate(); userStore[SecurityConst.ROLE_SECURITY_ADMIN.ToLowerInvariant()] = new User { Login = SecurityConst.ROLE_SECURITY_ADMIN, Roles = new [] { SecurityConst.ROLE_SECURITY_ADMIN } }.Activate(); userStore[SecurityConst.ROLE_USER.ToLowerInvariant()] = new User { Login = SecurityConst.ROLE_USER }.Activate(); userStore["existed@groups"] = new User { Login = "******", IsGroup = true }.Activate(); minimalValidRequest = new ClientRecord { Name = "ОАО Тест", IsDemo = true }; doubleRequest = new ClientRecord { Name = "ОАО Existed", IsDemo = true }; passwordManager = new PasswordManager(); passLogon = new PasswordLogon { UserService = userService }; userStateChecker = new UserStateChecker { UserService = userService }; }
/// <summary> /// Конструктор /// </summary> public AuthenticationService(IAuthenticationManager authenticationManager, IRepository <Identity> identityRepository, IPasswordManager passwordManager) { _authenticationManager = authenticationManager; _identityRepository = identityRepository; _passwordManager = passwordManager; }
public SshProxyCredentials(IPasswordManager passwordManager, string username, string password) { _passwordManager = passwordManager; Username = username; UseSshKey = false; Password = password; }
public SshProxyCredentials(IPasswordManager passwordManager, DatabaseConnection connection) { _passwordManager = passwordManager; Username = connection.SshUsername; UseSshKey = connection.UseSshKey; if (connection.UseSsh) { this.PrivateKeyFile = null; if (connection.UseSshKey) { if (connection.SshKeyFile != null) { var data = _passwordManager.GetSecret(SecretType.SshKeyFile.ToString() + "_" + connection.SshKeyFile.Id); if (data != null) { this.PrivateKeyFile = new PrivateKeyFile(new MemoryStream(Convert.FromBase64String(data))); } } } else { UseSshKey = false; Password = _passwordManager.GetSecret(SecretType.SSHPassword.ToString() + "_" + connection.DatabaseConnectionID); } } }
void OnResetPassword(object sender, EventArgs e) { Debug.Assert(EnablePasswordReset); if (RequiresQuestionAndAnswer) { ResetWithQuestionDialog dialog = new ResetWithQuestionDialog(ServiceAddress, ApplicationName, UserName); dialog.ShowDialog(); } else { IPasswordManager passwordManager = UserManagerProviderFactory.CreatePasswordManager(); // new AspNetSqlProviderService(ServiceAddress); string newPassword = null; try { newPassword = passwordManager.ResetPassword(ApplicationName, UserName); Clipboard.SetText(newPassword); } catch (SoapException exception) { if (exception.Message.Contains("The user account has been locked out")) { MessageBox.Show("The user account has been locked out", "Credentials Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } throw; } MessageBox.Show("Generated password: "******" " + Environment.NewLine + "The password is avaiable on the clipboard as well.", "Credentials Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
void RefreshPasswordsPage() { if (ApplicationName == String.Empty) { m_PasswordReset.Text = "-"; m_PasswordRetrieval.Text = "-"; m_MaxInvalidAttempts.Text = "-"; m_MinNonAlphanumeric.Text = "-"; m_MinLength.Text = "-"; m_AttemptWindow.Text = "-"; m_PasswordRegularExpression.Text = "-"; m_RequiresQuestionAndAnswerLabel.Text = "-"; m_LengthTextBox.Text = String.Empty; m_NonAlphanumericTextBox.Text = String.Empty; m_GeneratePasswordMenuItem.Enabled = m_GeneratePassword.Enabled = false; return; } m_GeneratePasswordMenuItem.Enabled = m_GeneratePassword.Enabled = true; IPasswordManager passwordManager = UserManagerProviderFactory.CreatePasswordManager(); // new AspNetSqlProviderService(ServiceAddress); if (passwordManager.EnablePasswordReset(ApplicationName)) { EnablePasswordReset = true; m_PasswordReset.Text = "Yes"; } else { EnablePasswordReset = false; m_PasswordReset.Text = "No"; } if (passwordManager.EnablePasswordRetrieval(ApplicationName)) { EnablePasswordRetrieval = true; m_PasswordRetrieval.Text = "Yes"; } else { EnablePasswordRetrieval = false; m_PasswordRetrieval.Text = "No"; } m_MaxInvalidAttempts.Text = passwordManager.GetMaxInvalidPasswordAttempts(ApplicationName).ToString(); m_MinNonAlphanumeric.Text = passwordManager.GetMinRequiredNonAlphanumericCharacters(ApplicationName).ToString(); m_MinLength.Text = passwordManager.GetMinRequiredPasswordLength(ApplicationName).ToString(); m_AttemptWindow.Text = passwordManager.GetPasswordAttemptWindow(ApplicationName).ToString(); m_PasswordRegularExpression.Text = passwordManager.GetPasswordStrengthRegularExpression(ApplicationName); if (passwordManager.RequiresQuestionAndAnswer(ApplicationName)) { RequiresQuestionAndAnswer = true; m_RequiresQuestionAndAnswerLabel.Text = "Yes"; } else { RequiresQuestionAndAnswer = false; m_RequiresQuestionAndAnswerLabel.Text = "No"; } m_LengthTextBox.Text = m_MinLength.Text; m_NonAlphanumericTextBox.Text = m_MinNonAlphanumeric.Text; }
public UserBuilder( IPasswordManager passwordManager, IGuidIdGenerator guidIdGenerator) { this.passwordManager = passwordManager; this.guidIdGenerator = guidIdGenerator; }
public void Setup() { _passwordManager = Substitute.For <IPasswordManager>(); _userRepository = Substitute.For <IUserRepository>(); _apiKeyGenerator = Substitute.For <IApiKeyGenerator>(); _userServiceInstance = new UserService(_passwordManager, _userRepository, _apiKeyGenerator); }
public DemoMigrator( SQLiteConnectionManager sqliteConnectionManager, IPasswordManager passwordManager) { _passwordManager = passwordManager; _sqliteConnection = sqliteConnectionManager.Connection; }
public DialogCreator(INotificationService notificationService, IPasswordManager passwordManager, ISyncService syncService, GPG gpg) { this.notificationService = notificationService ?? throw new ArgumentNullException(nameof(notificationService)); this.passwordManager = passwordManager ?? throw new ArgumentNullException(nameof(passwordManager)); this.syncService = syncService; this.gpg = gpg; }
/// <summary> /// Initializes a new instance of the <see cref="LinkedInDataProvider"/> class. /// Constructor. /// </summary> /// <param name="tokens">OAuth tokens for request.</param> /// <param name="requiredPermissions">Required permissions for the session.</param> public LinkedInDataProvider(LinkedInOAuthTokens tokens, LinkedInPermissions requiredPermissions) { Tokens = tokens; RequiredPermissions = requiredPermissions; _authentication = new UwpAuthenticationBroker(); _storageManager = new UwpStorageManager(); _passwordManager = new UwpPasswordManager(); }
public UserManagementService(IWebApplicationServices applicationServices) { _applicationServices = applicationServices; _dataProvider = applicationServices.WebSecurity.DataProvider; _passwordManager = applicationServices.WebSecurity.PasswordManager; _policyEnforcer = applicationServices.WebSecurity.PolicyEnforcer; }
/// <summary> /// Initializes a new instance of the <see cref="SignupController"/> class. /// </summary> /// <param name="signupManager">The signup manager.</param> /// <param name="userManager">The user manager.</param> /// <param name="passwordManager">The password manager.</param> /// <param name="ISecurityManager">The JWT packet manager.</param> public SignupController(ISignupManager signupManager, IUserManager userManager, IPasswordManager passwordManager, ISecurityManager securityManager, IEmailManager emailManager) { _signUpManager = signupManager; _userManager = userManager; _passwordManager = passwordManager; _securityManager = securityManager; _emailManager = emailManager; }
/// <summary> /// Initializes a new instance of the <see cref="LinkedInDataProvider"/> class. /// Constructor. /// </summary> /// <param name="tokens">OAuth tokens for request.</param> /// <param name="requiredPermissions">Required permissions for the session.</param> /// <param name="authentication">Authentication result interface.</param> /// <param name="passwordManager">Password Manager interface, store the password.</param> /// <param name="storageManager">Storage Manager interface.</param> public LinkedInDataProvider(LinkedInOAuthTokens tokens, LinkedInPermissions requiredPermissions, IAuthenticationBroker authentication, IPasswordManager passwordManager, IStorageManager storageManager) { Tokens = tokens; RequiredPermissions = requiredPermissions; _authentication = authentication; _storageManager = storageManager; _passwordManager = passwordManager; }
public SshKeyFileController( ApplicationDbContext dbContext, IPasswordManager passwordManager, UserManager <ApplicationUser> userManager) : base(userManager, dbContext) { _passwordManager = passwordManager; }
public AccountLogic(IUserRepository UserRepository, IRolesRepository RolesRepository, IPasswordManager PasswordManager, IRepository <Customer> customerRepository) { userRepository = UserRepository; rolesRepository = RolesRepository; passwordManager = PasswordManager; this.customerRepository = customerRepository; }
public AuthService( IUnitOfWork unitOfWork, IJwtTokenProvider jwtTokenProvider, IPasswordManager passwordManager) : base(unitOfWork) { _passwordManager = passwordManager; _jwtTokenProvider = jwtTokenProvider; }
public void Init() { _passwordStore = new Mock <IPasswordStore>(); var encryptor = new PassThruEncryptor(); _passwordManager = new PasswordManager(new PasswordHasher(11528), _passwordStore.Object, encryptor); }
public SeedService( string dirPath, IPasswordManager passwordManager, ILogger logger) { _dirPath = dirPath; _passwordManager = passwordManager; _logger = logger; }
public IpfsAdapterTests(ITestOutputHelper output) : base(output) { _passwordManager = Substitute.For <IPasswordManager>(); _passwordManager.RetrieveOrPromptAndAddPasswordToRegistry(PasswordRegistryTypes.IpfsPassword, Arg.Any <string>()).ReturnsForAnyArgs( TestPasswordReader.BuildSecureStringPassword("abcd")); _logger = Substitute.For <ILogger>(); }
public DfsService(IBitSwapApi bitSwapApi, BitSwapService bitSwapService, IBlockApi blockApi, IBlockRepositoryApi blockRepositoryApi, IBootstrapApi bootstrapApi, IConfigApi configApi, IDagApi dagApi, IDhtApi dhtApi, IDnsApi dnsApi, KatDhtService dhtService, IUnixFsApi unixFsApi, IKeyApi keyApi, INameApi nameApi, IObjectApi objectApi, IPinApi pinApi, Ping1 pingService, IPubSubApi pubSubApi, PubSubService pubSubService, IStatsApi statsApi, ISwarmApi swarmApi, SwarmService swarmService, DfsOptions dfsOptions, IHashProvider hashProvider, DfsState dfsState, IPasswordManager passwordManager, IMigrationManager migrationManager, Peer localPeer) { BitSwapApi = bitSwapApi; BitSwapService = bitSwapService; BlockApi = blockApi; BlockRepositoryApi = blockRepositoryApi; BootstrapApi = bootstrapApi; ConfigApi = configApi; DagApi = dagApi; DhtApi = dhtApi; DhtService = dhtService; UnixFsApi = unixFsApi; KeyApi = keyApi; NameApi = nameApi; ObjectApi = objectApi; PinApi = pinApi; PingService = pingService; PubSubApi = pubSubApi; PubSubService = pubSubService; StatsApi = statsApi; SwarmApi = swarmApi; SwarmService = swarmService; Options = dfsOptions; _hashProvider = hashProvider; _dfsState = dfsState; DnsApi = dnsApi; MigrationManager = migrationManager; LocalPeer = localPeer; InitAsync().Wait(); }
public LocalKeyStoreTests(ITestOutputHelper output) : base(output) { _fileSystem = Substitute.For <IFileSystem>(); _context = new FfiWrapper(); var logger = Substitute.For <ILogger>(); _passwordManager = Substitute.For <IPasswordManager>(); _passwordManager.RetrieveOrPromptPassword(default)
public Facade(IDatabase database, IConfiguration configuration, IPasswordManager passwordManager, ISecurityTokenService securityTokenService, IMailNotifier mailNotifier, IDocumentStore documentStore) { _database = database; _configuration = configuration; _passwordManager = passwordManager; _securityTokenService = securityTokenService; _mailNotifier = mailNotifier; _documentStore = documentStore; }
public ResetWithQuestionDialog(string url,string application,string user) { InitializeComponent(); m_Url = url; m_Application = application; m_UserNameTextBox.Text = user; m_PasswordManager = UserManagerProviderFactory.CreatePasswordManager(); // new AspNetSqlProviderService(m_Url); m_PasswordQuestionTextBox.Text = m_PasswordManager.GetPasswordQuestion(application,user); }
public void Setup() { clientService = new ClientService( userService = new UserService( userStore = new DictionaryUserSource())); userStore[SecurityConst.ROLE_ADMIN.ToLowerInvariant()] = new User {Login = SecurityConst.ROLE_ADMIN,IsAdmin = true}.Activate(); userStore[SecurityConst.ROLE_SECURITY_ADMIN.ToLowerInvariant()] = new User {Login = SecurityConst.ROLE_SECURITY_ADMIN, Roles = new [] {SecurityConst.ROLE_SECURITY_ADMIN}}.Activate(); userStore[SecurityConst.ROLE_USER.ToLowerInvariant()] = new User {Login = SecurityConst.ROLE_USER }.Activate(); userStore["existed@groups"] = new User {Login = "******",IsGroup = true}.Activate(); minimalValidRequest = new ClientRecord {Name = "ОАО Тест",IsDemo = true}; doubleRequest = new ClientRecord {Name = "ОАО Existed",IsDemo = true}; passwordManager = new PasswordManager(); passLogon = new PasswordLogon {UserService = userService}; userStateChecker = new UserStateChecker {UserService = userService}; }
public UserManager( IUserRepository userRepository, IConfirmationService confirmationService, PaginationSettings paginationSettings, IProjectMembershipRepostiory projectMembershipRepostiory, IMailer mailer, ApplicationLocationSettings applicationLocationSettings, IPasswordManager passwordManager) { Require.NotNull(userRepository, nameof(userRepository)); Require.NotNull(confirmationService, nameof(confirmationService)); _userRepository = userRepository; _confirmationService = confirmationService; _paginationSettings = paginationSettings; _projectMembershipRepostiory = projectMembershipRepostiory; _mailer = mailer; _applicationLocationSettings = applicationLocationSettings; _passwordManager = passwordManager; }
public DevelopersController( IUserManager userManager, DevelopersMapper mapper, IConfirmationService confirmationService, IUserPresentationProvider userPresentationProvider, IPaginationWrapper<Account> paginationWrapper, IPasswordManager passwordManager) { Require.NotNull(userManager, nameof(userManager)); Require.NotNull(mapper, nameof(mapper)); Require.NotNull(confirmationService, nameof(confirmationService)); Require.NotNull(userPresentationProvider, nameof(userPresentationProvider)); _userManager = userManager; _mapper = mapper; _confirmationService = confirmationService; _userPresentationProvider = userPresentationProvider; _paginationWrapper = paginationWrapper; _passwordManager = passwordManager; }
public UserProvider(IUserRepository customerRepository, IPasswordManager passwordManager, ISiteConfiguration siteConfiguration) { _customerRepository = customerRepository; _passwordManager = passwordManager; _siteConfiguration = siteConfiguration; }
public MembershipService(IDbConnectionProvider conn, IPasswordManager passwordManager) { _conn = conn; _passwordManager = passwordManager; }
public RegisterWebUserStrategy(IPasswordManager passwordManager) { _passwordManager = passwordManager; }
public LogInStrategy(IPasswordManager passwordManager) { _passwordManager = passwordManager; }
public AccountController(IUserService userService,IPasswordManager passwordManager,ISessionManager sessionManager) { _userService = userService; _passwordManager = passwordManager; _sessionManager = sessionManager; }
public static void Setup(TestContext testContext) { _passwordManager = new PasswordManager(); }