コード例 #1
0
        public Login(IPlayer player, ILoginHandler loginHandler)
        {
            this.player       = player;
            this.loginHandler = loginHandler;

            loginHandler.OnLoginAck += onLoginAck;
        }
コード例 #2
0
 public LoginCommandsModule(IActionFactory actionFactory,
                            ITribeManager tribeManager,
                            IDbManager dbManager,
                            ILocker locker,
                            IWorld world,
                            Procedure procedure,
                            ICityFactory cityFactory,
                            ILocationStrategyFactory locationStrategyFactory,
                            IBarbarianTribeManager barbarianTribeManager,
                            CallbackProcedure callbackProcedure,
                            IChannel channel,
                            IThemeManager themeManager,
                            IPlayerFactory playerFactory,
                            ILoginHandler loginHandler)
 {
     this.actionFactory           = actionFactory;
     this.tribeManager            = tribeManager;
     this.dbManager               = dbManager;
     this.locker                  = locker;
     this.world                   = world;
     this.procedure               = procedure;
     this.callbackProcedure       = callbackProcedure;
     this.channel                 = channel;
     this.themeManager            = themeManager;
     this.playerFactory           = playerFactory;
     this.loginHandler            = loginHandler;
     this.cityFactory             = cityFactory;
     this.locationStrategyFactory = locationStrategyFactory;
     this.barbarianTribeManager   = barbarianTribeManager;
 }
コード例 #3
0
ファイル: AuthController.cs プロジェクト: jellydong/LJDAPP
 public AuthController(ILogger <AuthController> logger, ILoginHandler loginHandler, IUserService userService, ILoginInfo loginInfo)
 {
     _logger       = logger;
     _loginHandler = loginHandler;
     _userService  = userService;
     _loginInfo    = loginInfo;
 }
コード例 #4
0
        public void Setup()
        {
            // Participant Setup
            participants = new List <Participant>
            {
                new Participant
                {
                    Email         = "*****@*****.**",
                    Age           = DateTime.Now,
                    English       = true,
                    Gender        = true,
                    IdParticipant = 0,
                    Password      = "******"
                }
            }.AsQueryable();

            // Required to do this. If not the "mock" does not recognize "part" in uut.RegisterParticipantDB
            mockSet = new Mock <DbSet <Participant> >();
            mockSet.As <IQueryable <Participant> >().Setup(m => m.Provider).Returns(participants.Provider);
            mockSet.As <IQueryable <Participant> >().Setup(m => m.Expression).Returns(participants.Expression);
            mockSet.As <IQueryable <Participant> >().Setup(m => m.ElementType).Returns(participants.ElementType);
            mockSet.As <IQueryable <Participant> >().Setup(m => m.GetEnumerator()).
            Returns((IEnumerator <Participant>)participants.GetEnumerator());

            mockContext = new Mock <BachelorBackEnd.bachelordbContext>();
            mockContext.Setup(c => c.Participant).Returns(mockSet.Object);
            uut = new LoginHandler(mockContext.Object);
        }
コード例 #5
0
ファイル: NodeClientBuilder.cs プロジェクト: mengtest/XNode
        private void BuildConfig()
        {
            CheckIsBuild();

            if (connectionInfos == null)
            {
                throw new InvalidOperationException("Connections is not config.");
            }

            if (serializer == null)
            {
                throw new InvalidOperationException("Serializer is not config.");
            }

            if (communicationFactory == null)
            {
                throw new InvalidOperationException("CommunicationFactory is not config.");
            }

            if (protocolStackFactory == null)
            {
                protocolStackFactory = new DefaultProtocolStackFactory();
            }

            if (loginHandler == null)
            {
                loginHandler = new DefaultLoginHandler(null, serializer, LoggerManager.ClientLoggerFactory);
            }

            if (passiveClosedStrategy == null)
            {
                passiveClosedStrategy = new DefaultPassiveClosedStrategy(new DefaultPassiveClosedStrategyConfig(), LoggerManager.ClientLoggerFactory);
            }
        }
コード例 #6
0
 public AuthController(IAuthService service, ILoginHandler loginHandler, IpHelper ipHelper, ILoginClaimsExtendProvider claimsExtendProvider)
 {
     _service              = service;
     _loginHandler         = loginHandler;
     _ipHelper             = ipHelper;
     _claimsExtendProvider = claimsExtendProvider;
 }
コード例 #7
0
 public BlockedApiLoginHandler(ILoginHandler loginHandler, IUserContext userContext, ILogger logger, IVpnConnectionManager connectionManager)
 {
     this._loginHandler      = loginHandler;
     this._userContext       = userContext;
     this._logger            = logger;
     this._connectionManager = connectionManager;
 }
コード例 #8
0
 public LoginViewModel(ILoginHandler loginHandler, IBrowser browser)
 {
     this._loginHandler                      = loginHandler;
     this._browser                           = browser;
     this.< Login > k__BackingField          = new RelayCommand <PasswordBox>(new Action <PasswordBox>(this.LoginCommand), (PasswordBox passwordBox) => !this.Connecting);
     this.< ForgotPassword > k__BackingField = new RelayCommand(new Action(this.ForgotPasswordCommand));
     this.StartAnimation                     = true;
 }
コード例 #9
0
 public LoginViewModel(ILoginHandler loginHandler, IBrowser browser, EventFacade eventFacade)
 {
     this._loginHandler = loginHandler;
     this._browser      = browser;
     this._eventFacade  = eventFacade;
     this._loginHandler.UserContext.add_UserLoginFailed(new EventHandler <UserEventArgs>(this.SetCredentials));
     this._loginHandler.UserContext.add_UserLoggedOut(new EventHandler <UserEventArgs>(this.ClearCredentials));
 }
コード例 #10
0
ファイル: NodeClientBuilder.cs プロジェクト: mengtest/XNode
        /// <summary>
        /// 配置登录处理器
        /// </summary>
        /// <param name="loginHandler">登录处理器</param>
        /// <returns></returns>
        public INodeClientBuilder ConfigLoginHandler(ILoginHandler loginHandler)
        {
            CheckIsBuild();

            this.loginHandler = loginHandler;

            return(this);
        }
コード例 #11
0
 public RegisterViewModel(EventFacade eventFacade, IBrowser browser, ILoginHandler loginHandler)
 {
     this._eventFacade  = eventFacade;
     this._browser      = browser;
     this._loginHandler = loginHandler;
     this.< Register > k__BackingField = new RelayCommand <PasswordBox>(new Action <PasswordBox>(this.RegisterCommand), (PasswordBox passwordBox) => !this.Connecting);
     this.< Back > k__BackingField     = new RelayCommand(new Action(this.BackCommand));
 }
コード例 #12
0
 /// <summary>
 /// Constructor - uses dependency injection and calls the base constructor.
 /// </summary>
 /// <param name="svc">DI service.</param>
 /// <param name="logger">DI logger</param>
 public AuthenticationController(IAPIModelService <UsersDTO> service, ILoginHandler <UsersDTO> loginHandler, ILogger <AuthenticationController> logger, IConfiguration config, UserSettings settings)
 {
     _loginHandler = loginHandler;
     Logger        = logger;
     this.config   = config;
     this.settings = settings;
     this.Service  = service;
 }
コード例 #13
0
 public ConnectApiHandler(IConnectionManager connectionManager, ILoginHandler loginHandler, IExceptionHandler exHandler)
 {
     _connectionManager = connectionManager;
     _loginHandler      = loginHandler;
     _exHandler         = exHandler;
     Me             = new MyAccount();
     _mappingEngine = GetMapper();
     SetupListeners();
 }
コード例 #14
0
        public void ClearPassword()
        {
            Password?.Clear();
            ILoginHandler handler = IoC.Get <ILoginHandler>();

            if (handler != null)
            {
                handler.ClearPassword();
            }
        }
コード例 #15
0
        public RealizarLoginParaAutenticarNoSistemaSteps(ScenarioContext context)
        {
            var _serviceProvider = new StartInjection().ServiceProvider;

            _loginHandler = _serviceProvider.GetService <ILoginHandler>();
            _dataStart    = _serviceProvider.GetService <IDataStart>();
            // Popula base de dados
            //_dataStart.Seed();
            _context = context;
        }
コード例 #16
0
        public void LoginParticipantDB_Login_WithInValidUser()
        {
            //Setup

            //Act - trying to log in
            uut = new LoginHandler(mockContext.Object);
            var actual = uut.LoginResearcherDB("bla", "bla");

            //Assert - Checking Loginstatus.IsSuccess.
            Assert.IsFalse(actual.success);
        }
コード例 #17
0
        public void LoginResearcherDB_Login_WithInvalidEmail()
        {
            //Setup

            //Act - trying to log in
            uut = new LoginHandler(mockContext.Object);
            var actual = uut.LoginResearcherDB("bla", "123456");

            //Assert - Checking Loginstatus.ErrorMessage.
            Assert.AreEqual(actual.errormessage, "No researcher with this email exists");
        }
コード例 #18
0
        public void LoginResearcherDB_Login_WithInvalidPassword()
        {
            //Setup

            //Act - trying to log in
            uut = new LoginHandler(mockContext.Object);
            var actual = uut.LoginResearcherDB("*****@*****.**", "bla");

            //Assert - Checking Loginstatus.ErrorMessage.
            Assert.AreEqual(actual.errormessage, "Wrong password");
        }
コード例 #19
0
 public AuthController(ILogger <UserController.UserController> logger, IJwtService jwtService,
                       UserManager <User> userManager, ILoginHandler loginHandler, IRefreshTokenHandler refreshTokenHandler,
                       ILogoutHandler logoutHandler)
 {
     _logger              = logger;
     _jwtService          = jwtService;
     _userManager         = userManager;
     _loginHandler        = loginHandler;
     _refreshTokenHandler = refreshTokenHandler;
     _logoutHandler       = logoutHandler;
 }
コード例 #20
0
        public void LoginResearcherDB_Login_WithValidUser()
        {
            //Setup

            //Act - trying to log in
            uut = new LoginHandler(mockContext.Object);
            var actual = uut.LoginResearcherDB("*****@*****.**", "123456");

            //Assert - Checking Loginstatus.IsSuccess.
            Assert.IsTrue(actual.success);
        }
コード例 #21
0
        public HomeView(BrowserInterop browserInterop, ILoginHandler loginHandler, IConnectApiHandler connMan)
        {
            InitializeComponent();
            _loginHandler = loginHandler;

            WebControl.LifeSpanHandler = new LifeSpanHandler();

            WebControl.RegisterJsObject("six_client", new Handler(browserInterop, connMan, HandleLogin));

            this.WhenActivated(d => {
                d(this.WhenAnyValue(x => x.ViewModel).BindTo(this, v => v.DataContext));
                d(this.WhenAnyValue(x => x.ViewModel)
                  .Skip(1)
                  .Subscribe(vm => {
                    d(WebControl.WhenAnyValue(x => x.IsLoading).Subscribe(x => {
                        ViewModel.ProgressState.Active = x;
                        ViewModel.CanGoBack            = WebControl.CanGoBack;
                        ViewModel.CanGoForward         = WebControl.CanGoForward;
                    }));
                    d(vm.Navigate.Subscribe(x => {
                        switch (x)
                        {
                        case HomeViewModel.NavigateMode.GoBack: {
                            WebControl.BackCommand.Execute(null);
                            break;
                        }

                        case HomeViewModel.NavigateMode.Abort: {
                            WebControl.Stop();
                            break;
                        }

                        case HomeViewModel.NavigateMode.GoForward: {
                            WebControl.ForwardCommand.Execute(null);
                            break;
                        }

                        case HomeViewModel.NavigateMode.Reload: {
                            WebControl.Reload(false);
                            break;
                        }
                        }
                    }));
                }));

                d(this.WhenAnyValue(v => v.WebControl.IsLoading)
                  .Skip(1)
                  .Subscribe(x => ViewModel.IsNavigating = x));
            });

            CommandBindings.Add(new CommandBinding(BrowserView.CopyToClipboard, OnCopyToClipboard, CanCopyToClipboard));
            CommandBindings.Add(new CommandBinding(BrowserView.OpenInSystemBrowser, OnOpenInSystemBrowser,
                                                   CanOpenInSystemBrowser));
        }
コード例 #22
0
        /// <summary>
        /// Keep history of current user.<br />
        /// Clear transaction data.
        /// </summary>
        /// <returns></returns>
        public ActionResult Logout()
        {
            dsTransDataModel dsTrans = CommonUtil.dsTransData;

            if (dsTrans != null)
            {
                ILoginHandler handLogin = ServiceContainer.GetService <ILoginHandler>() as ILoginHandler;
                handLogin.KeepHistory(CommonUtil.dsTransData.dtUserData.EmpNo, LogType.C_LOG_OUT);
                CommonUtil.dsTransData = null;
            }

            return(Json(true));
        }
コード例 #23
0
 public SettingsTabViewModel(VpnConnector vpnConnector, SettingsContainerViewModel settingsContainerViewModel, MyAccountViewModel myAccountViewModel, IMessageBoxService messageBoxService, EventFacade eventFacade, ILoginHandler loginHandler, IBrowser browser)
 {
     this._vpnConnector      = vpnConnector;
     this._loginHandler      = loginHandler;
     this._messageBoxService = messageBoxService;
     this._eventFacade       = eventFacade;
     this._browser           = browser;
     base.get_Items().AddRange(new Screen[]
     {
         settingsContainerViewModel,
         myAccountViewModel
     });
 }
コード例 #24
0
 public RegisterProviderMiddleware(RequestDelegate next,
                                   IOptions <TokenProviderOptions> options,
                                   IAccountRepository accountRepository,
                                   IAuthInternalRepository internalRepository,
                                   ILogger <RegisterService> registerLogger,
                                   ILogger <AllegroRegisterHandler> allegroLogger,
                                   ApplicationDbContext context)
 {
     _next            = next;
     _options         = options.Value;
     _loginHandler    = new AllegroRegisterHandler(allegroLogger);
     _registerService = new RegisterService(accountRepository, registerLogger, internalRepository, context);
 }
コード例 #25
0
 public AppStartupLoginHandler(ILoginHandler loginHandler, BlockedApiLoginHandler blockedApiLoginHandler, ServersUpdateTimer serversUpdateTimer, ServiceWatcher serviceWatcher, INotificationProvider notificationProvider, AutoConnectManager autoConnectManager, OpenVpnConfigsUpdateTimer openVpnConfigsUpdateTimer, VpnConnectionWatcher wcfServiceWatcher, SettingsServiceClientManager settingsServiceClientManager, FavouritesManager favouriteServersUpdater, CyberSecHostsStorage cyberSecHostsStorage)
 {
     this._serversUpdateTimer           = serversUpdateTimer;
     this._serviceWatcher               = serviceWatcher;
     this._notificationProvider         = notificationProvider;
     this._autoConnectManager           = autoConnectManager;
     this._openVpnConfigsUpdateTimer    = openVpnConfigsUpdateTimer;
     this._wcfServiceWatcher            = wcfServiceWatcher;
     this._settingsServiceClientManager = settingsServiceClientManager;
     this._favouriteServersUpdater      = favouriteServersUpdater;
     this._loginHandler           = loginHandler;
     this._blockedApiLoginHandler = blockedApiLoginHandler;
     this._cyberSecHostsStorage   = cyberSecHostsStorage;
 }
コード例 #26
0
        private static bool HandleLogin(ILoginHandler loginHandler)
        {
            if (!loginHandler.CreateFirstUserIfNeeded())
            {
                return(false);
            }

            if (!loginHandler.Login())
            {
                return(false);
            }

            return(true);
        }
コード例 #27
0
 public AccountAppService(
     ILoginHandler loginHandler,
     LoginPresenter loginPresenter,
     IExchangeRefreshTokenHandler exchangeRefreshTokenHandler,
     ExchangeRefreshTokenPresenter exchangeRefreshTokenPresenter,
     IRegisterUserHandler registerUserHandler,
     IOptions <AuthSettings> authSettings)
 {
     _loginHandler   = loginHandler;
     _loginPresenter = loginPresenter;
     _exchangeRefreshTokenHandler   = exchangeRefreshTokenHandler;
     _exchangeRefreshTokenPresenter = exchangeRefreshTokenPresenter;
     _registerUserHandler           = registerUserHandler;
     _authSettings = authSettings.Value;
 }
コード例 #28
0
ファイル: Server.cs プロジェクト: dianaslv/SwimmingContestApp
        public Server(ILoginHandler loginHandler, ILogger <Server> logger, ISearchContestTasksHandler searchContestTasksHandler, IAddParticipantHandler addParticipantHandler, IAddEntryHandler addEntryHandler, ISearchParticipantsHandler searchParticipantHandler,
                      ISearchParticipantsJoin searchParticipantJoinHandler)
        {
            m_loginHandler = loginHandler;
            m_logger       = logger;
            m_searchContestTasksHandler    = searchContestTasksHandler;
            m_addParticipantHandler        = addParticipantHandler;
            m_addEntryHandler              = addEntryHandler;
            m_searchParticipantHandler     = searchParticipantHandler;
            m_searchParticipantJoinHandler = searchParticipantJoinHandler;
            var ipAddress = IPAddress.Parse(Address);

            m_tcpListener = new TcpListener(ipAddress, Port);
            m_tcpListener.Start();
        }
コード例 #29
0
 public LoginMutation(ILoginHandler handler)
 {
     FieldAsync <LoginQueryType>(
         "sendLogin",
         arguments: new QueryArguments(new QueryArgument <NonNullGraphType <LoginCreateViewModel> >
     {
         Name = "request"
     }),
         resolve: async context =>
     {
         var house = context.GetArgument <LoginRequest>("request");
         return(await context.TryAsyncResolve(async _ => await handler.ProcessRequest(house)));
     }
         );
 }
コード例 #30
0
 public SettingsTabViewModel(IVpnConnectionManager vpnConnectionManager, SettingsContainerViewModel settingsContainerViewModel, MyAccountViewModel myAccountViewModel, LogViewModel logViewModel, IMessageBoxService messageBoxService, EventFacade eventFacade, ILoginHandler loginHandler, IBrowser browser)
 {
     this._vpnConnectionManager = vpnConnectionManager;
     this._loginHandler         = loginHandler;
     this._messageBoxService    = messageBoxService;
     this._eventFacade          = eventFacade;
     this._browser = browser;
     this.< Logout > k__BackingField     = new RelayCommand(new Action(this.LogoutCommand));
     this.< HelpCenter > k__BackingField = new RelayCommand(new Action(this.HelpCenterCommand));
     base.get_Items().AddRange(new Screen[]
     {
         settingsContainerViewModel,
         myAccountViewModel,
         logViewModel
     });
 }
コード例 #31
0
ファイル: AuthController.cs プロジェクト: upta/gemfire
 public AuthController( ILoginHandler loginHandler, IRegistrationHandler registrationHandler )
 {
     this.loginHandler = loginHandler;
     this.registrationHandler = registrationHandler;
 }