示例#1
0
 public AuthController(IAuthService authService, IUserService userService, IAccountService accountService, IAuthStorage authStorage, IStringLocalizer <AppResources> stringLocalizer)
 {
     _authService     = authService ?? throw new ArgumentNullException(nameof(authService));
     _userService     = userService ?? throw new ArgumentNullException(nameof(userService));
     _accountService  = accountService ?? throw new ArgumentNullException(nameof(accountService));
     _authStorage     = authStorage;
     _stringLocalizer = stringLocalizer;
 }
示例#2
0
 public AccountService(
     IDinnerPrincipalProvider principalProvider,
     IAuthStorage authStorage,
     IPasswordHashProvider passwordHashProvider,
     IUserDinnerStorage userDinnerStorage,
     IRandomStringGenerator stringGenerator,
     IEmailSystem emailSystem)
 {
     this.principalProvider    = principalProvider;
     this.authStorage          = authStorage;
     this.passwordHashProvider = passwordHashProvider;
     this.userDinnerStorage    = userDinnerStorage;
     this.stringGenerator      = stringGenerator;
     this.emailSystem          = emailSystem;
 }
示例#3
0
 public AuthWindow()
 {
     InitializeComponent();
     _default = GuestButton.Background;
     try
     {
         accountManager = new LocalAccountManager(Properties.Settings.Default.AuthStorage);
     }
     catch
     {
         new MessageBlock("Can't connect to datastore")
         {
             WindowStartupLocation = WindowStartupLocation.CenterScreen
         }.ShowDialog();
         this.Close();
     }
 }
示例#4
0
 public AuthService(IAuthStorage authStorage)
 {
     _authStorage = authStorage ?? throw new ArgumentNullException(nameof(authStorage));
 }
示例#5
0
 public Authorization(IAuthStorage storage)
 {
     _storage  = storage;
     _isClient = false;
     _sessions = new Dictionary <Token, AuthSession>();
 }
示例#6
0
 public RegisterWindow()
 {
     InitializeComponent();
     accountManager = new LocalAccountManager(Properties.Settings.Default.AuthStorage);
 }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SecurityService" /> class.
 /// </summary>
 /// <param name="authStorage">The authentication storage.</param>
 /// <param name="passwordHashProvider">The password hash provider.</param>
 /// <param name="eventLog">The event log.</param>
 public SecurityService(IAuthStorage authStorage, IPasswordHashProvider passwordHashProvider, IEventLog eventLog)
 {
     this.authStorage          = authStorage;
     this.passwordHashProvider = passwordHashProvider;
     this.eventLog             = eventLog;
 }