private async void AutenticatOfficerButton_Click(object sender, RoutedEventArgs e)
        {
            using (Logger.TraceMehtod())
            {
                try
                {
                    var user = UserName.Parse(AutenticateOfficerName.Text);
                    IEnumerable <LiveQuestion> liveQuestions = null;
                    try
                    {
                        liveQuestions = await authenticationService.GetEnrollmentDataLiveQuestion(user);
                    }
                    catch (Exception ex)
                    {
                    }

                    var cred = AuthenticateCredentialsWindow.ShowDialog(Application.Current.MainWindow, liveQuestions);

                    if (cred == null)
                    {
                        return;
                    }

                    officerTicket = await authenticationService.Authenticate(user, cred);

                    AuthenticateOfficerUserResult.Text = "Offecer token accepted.";
                }
                catch (Exception ex)
                {
                    AuthenticateOfficerUserResult.Text = ex.Message;
                }
            }
        }
예제 #2
0
        // [ValidateAntiForgeryToken]
        public async Task <IActionResult> Login(LoginModel model)
        {
            if (ModelState.IsValid)
            {
                var  hashPassword = HashPassword(model.Password);
                User user         = _dbContext.Users.Where(u =>
                                                           u.Email == model.Email && u.HashedPassword == hashPassword)
                                    .Include(u => u.Role)
                                    .FirstOrDefault();
                if (user == null)
                {
                    ModelState.AddModelError("", "Некорректные логин и(или) пароль");
                }
                else if (!user.IsConfirmed)
                {
                    ModelState.AddModelError("", "Email не подтвержден");
                }
                else
                {
                    await _authenticationService.Authenticate(user, model.RememberMe != null);

                    return(RedirectToAction("Index", "Home"));
                }
            }

            return(View(model));
        }
예제 #3
0
        public void Authenticate_With_Null_User_Should_Thow_Exeptions()
        {
            //arrange
            UserDto userDto = null;

            //when then
            Assert.ThrowsAsync <ArgumentNullException>(() => underTest.Authenticate(userDto));
        }
        public void AuthenticateUser_Successfull()

        {
            //act

            User account = _authService.Authenticate(name, password);



            //assert

            Assert.IsNotNull(account, "authentication failed!");
        }
 public void should_add_and_successfully_authenticate_the_first_user()
 {
     var userRepository = new MemoryRepository<User>();
     var authenticationService = new AuthenticationService(userRepository, new UserCreateService(userRepository));
     authenticationService.Authenticate(Username, Password);
     userRepository.Count().ShouldEqual(1);
 }
예제 #6
0
        public void Setup()
        {
            var uid = Environment.GetEnvironmentVariable("API_USER");
            var pwd = Environment.GetEnvironmentVariable("API_PASSWORD");

            _token = AuthenticationService.Authenticate(uid, pwd);
        }
        public void AuthenticationFailed()
        {
            // create mock objects
            var mockContainer          = MockRepository.GenerateStub <IContainer>();
            var mockAuthService        = MockRepository.GenerateStub <IAuthService>();
            var mockAccessTokenCreator = MockRepository.GenerateStub <IAccessTokenCreator>();

            // define mock calls
            mockAuthService.Stub(x => x.Login("non-user", "non-password")).Return(null);
            mockContainer.Stub(x => x.GetInstance <IAuthenticationResult>()).Return(new AuthenticationResult());

            // create test object
            var authenticationService = new AuthenticationService(mockContainer, mockAccessTokenCreator, mockAuthService);

            // run the test
            var result = authenticationService.Authenticate("non-user", "non-password");

            mockAuthService.AssertWasCalled(x => x.Login("non-user", "non-password"));
            mockContainer.AssertWasCalled(x => x.GetInstance <IAuthenticationResult>());

            Assert.AreEqual(true, result.IsValid);
            Assert.AreEqual(Resources.Content.AuthenticationResult_Failed, result.Message);
            Assert.AreEqual(null, result.AccessToken);
            Assert.AreEqual(null, result.IssuedAt);
        }
        public async Task Authenticate_WhenNotValidCredentials_ThrowsException()
        {
            RestClient            client = new RestClient(mockTokenProvider.Object);
            AuthenticationService authenticationService = new AuthenticationService(client, new EndpointResolver(baseUrl));

            Token token = await authenticationService.Authenticate("NotValidUser", "NotValidPassword");
        }
예제 #9
0
        public IActionResult Post(AuthorizationGrantRequestDTO token)
        {
            AuthenticationDTO Authorization = new AuthenticationDTO();

            try
            {
                IAuthenticationService tm = new AuthenticationService(
                    _refreshService,
                    _configuration,
                    _tSLogger,
                    _tokenService,
                    _tokenServiceDbContext,
                    _encryptionService);
                Authorization = tm.Authenticate(token);
            }
            catch (InvalidUserException exUser)
            {
                return(Unauthorized(new UnauthorizedError(exUser.Message)));
            }
            catch (Exception ex)
            {
                return(Unauthorized(new UnauthorizedError(ex.Message)));
            }
            return(Ok(Authorization));
        }
        public IActionResult Login(LoginModel model)
        {
            _logger.LogInformation("Trying to log user in");
            try
            {
                if (ModelState.IsValid)
                {
                    var email    = model.Email;
                    var password = model.Password;

                    _service.Authenticate(email, password, HttpContext);

                    ModelState.Clear();
                    return(RedirectToAction("Index", "Dashboard"));
                }

                ModelState.AddModelError("SubmitButton", "Email or password you entered is not correct. \n" +
                                         "Please try again.");
            }
            catch (CannotAuthenticateUser e)
            {
                _logger.LogWarning("User authentication failed: {}", e.Message);
            }

            return(RedirectToAction("Login"));
        }
예제 #11
0
        public List <WorkflowStateInfo> GetAvailiableWorkflowStateToSet(ApiCommandArgument arg)
        {
            var infos = new List <WorkflowStateInfo>();

            AuthenticationService.Authenticate(arg.SecurityToken);

            if (!AuthenticationService.IsAuthenticated())
            {
                return(infos);
            }


            if (!SecurityEntityService.CheckTrusteeWithIdIsInRole(AuthenticationService.GetCurrentIdentity().Id, BudgetRole.FullControl))
            {
                var permissions
                    = SecurityEntityService.GetAlPermissionsForTrusteeAndworkflow(arg.SecurityToken)
                      .Where(p => p.LinkedStateToSet != null)
                      .Select(p => p.LinkedStateToSet);

                if (permissions.Count() < 1)
                {
                    return(infos);
                }
                infos = WorkflowStateService.GetAllAvailiableStates(arg.InstanceId)
                        .Where(i => permissions.Count(p => p.WorkflowStateName == i.StateSystemName && p.Type.Id == i.WorkflowTypeId) > 0)
                        .ToList();
            }
            else
            {
                infos = WorkflowStateService.GetAllAvailiableStates(arg.InstanceId);
            }

            return(infos);
        }
예제 #12
0
        public IEnumerable <CommandExecutionStatus> MassExportBillDemands(ApiMassCommandEventArg arg)
        {
            AuthenticationService.Authenticate(arg.SecurityToken);

            if (!AuthenticationService.IsAuthenticated())
            {
                return(GetErrorExecutionStatuses(arg));
            }

            if (!AuthorizationService.IsAllowedToExecuteCommand(arg.InstanceIds, WorkflowCommandType.Export))
            {
                GetErrorExecutionStatuses(arg);
            }

            var states = new MultiThreadedPersistance <CommandExecutionStatus>();

            var handles = new List <WaitHandle>();

            foreach (var instanceId in arg.InstanceIds)
            {
                var handle = new AutoResetEvent(false);

                handles.Add(handle);

                var state = new MultipleExportBillDemandState {
                    InstanceId = instanceId, States = states, WaitHandle = handle, BillDemandBusinessService = BillDemandBuinessService, Identity = AuthenticationService.GetCurrentIdentity(), Comment = arg.Comment
                };

                ThreadPool.QueueUserWorkItem(RaiseBillDemandExportTask, state);
            }

            WaitHandle.WaitAll(handles.ToArray(), new TimeSpan(0, 0, 10, 0));

            return(states.Items);
        }
예제 #13
0
        public void ExportBillDemand(ApiCommandArgument arg)
        {
            AuthenticationService.Authenticate(arg.SecurityToken);

            if (!AuthenticationService.IsAuthenticated())
            {
                return;
            }

            if (!AuthorizationService.IsAllowedToExecuteCommand(arg.InstanceId, WorkflowCommandType.Export))
            {
                return;
            }

            FireCommandWithWaiting(arg, delegate(ApiCommandArgument arg1)
            {
                using (var sync = GetWorkflowSync(arg1))
                {
                    WorkflowInitService.RaiseExport(arg1.InstanceId);
                    sync.WaitHandle.WaitOne(60000);
                }
            });

            var state = WorkflowStateService.GetCurrentState(arg.InstanceId);

            if (state == WorkflowState.BillDemandInAccountingWithExport)
            {
                var errorMessage = WorkflowParcelService.GetAndRemoveMessage(arg.InstanceId);

                throw new FaultException <BaseFault>(new BaseFault((int)ErrorCodes.BillDemandUploadError),
                                                     new FaultReason(string.IsNullOrEmpty(errorMessage) ?
                                                                     "Не удалось выгрузить расходный документ. Попробуйте провести данную операцию еще раз. Если сообщение будет повторятся, обратитесь к Администратору." : errorMessage));
            }
        }
예제 #14
0
        public void SetPaidStatus(BillDemandPaidApiCommandArgument arg)
        {
            AuthenticationService.Authenticate(arg.SecurityToken);

            if (!AuthenticationService.IsAuthenticated())
            {
                return;
            }

            if (!AuthorizationService.IsAllowedToExecuteCommand(arg.InstanceId, WorkflowCommandType.SetPaidStatus))
            {
                return;
            }

            FireCommandWithWaiting(arg, delegate(BillDemandPaidApiCommandArgument arg1)
            {
                using (var sync = GetWorkflowSync(arg1))
                {
                    WorkflowInitService.RaiseSetPaidStatus(arg1.InstanceId,
                                                           arg1.PaymentDate,
                                                           arg1.DocumentNumber);
                    sync.WaitHandle.WaitOne(4000);
                }
            });
        }
예제 #15
0
        public void StartProcessing(ApiCommandArgument arg)
        {
            AuthenticationService.Authenticate(arg.SecurityToken);

            if (!AuthenticationService.IsAuthenticated())
            {
                return;
            }

            if (!AuthorizationService.IsAllowedToExecuteCommand(arg.InstanceId, WorkflowCommandType.StartProcessing))
            {
                return;
            }

            WorkflowInitService.CreateWorkflowIfNotExists(arg.InstanceId);

            using (var sync = GetWorkflowSync(arg))
            {
                sync.WaitHandle.WaitOne(4000);
            }

            FireCommandWithWaiting(arg, delegate(ApiCommandArgument arg1)
            {
                using (var sync = GetWorkflowSync(arg1))
                {
                    WorkflowInitService.RaiseStartProcessing(arg1.InstanceId);
                    sync.WaitHandle.WaitOne(4000);
                }
            });
        }
예제 #16
0
파일: Program.cs 프로젝트: erlama/Xml
        static void Main(string[] args)
        {
            //Nýja xml er XElement og er það þetta project. Gamla er XmlElement, dæmi um það er í ConasoleApp5 project!
            //Allir users eru skráðir inn í doc sem að við bjuggum til sjálf og er sparað inní debug hlutan af file eða þar sem að verkefnið er!
            //Þannig að ef að ég bæti við örðum user í það skjal þá getur sú manneksja loggað inn.

            //Hérna skrifum við út i consolen og með því að nota write ekki writeLine þá skrifarðu strax eftir username:
            Console.Write(" Username: "******" Password: "******"Successfully logged in!");
                Console.WriteLine($"Role {user.Role}");
            }
            else
            {
                Console.WriteLine("Access denide!");
            }
        }
예제 #17
0
        static void Main(string[] args)
        {
            string responseUrl;
            string requestUrl = AuthenticationService.GetWindowsLiveAuthenticationUrl();

            if (args.Length < 1)
            {
                Console.WriteLine("1) Open following URL in your WebBrowser:\n\n{0}\n\n" +
                                  "2) Authenticate with your Microsoft Account\n" +
                                  "3) Paste returned URL from addressbar: \n", requestUrl);

                // Caveat: Console.ReadLine() is limited to 254 chars on Windows
                responseUrl = Console.ReadLine();
            }
            else
            {
                responseUrl = args[0];
            }

            WindowsLiveResponse response = AuthenticationService.ParseWindowsLiveResponse(responseUrl);

            AuthenticationService authenticator = new AuthenticationService(
                new AccessToken(response), new RefreshToken(response));

            bool success = authenticator.Authenticate();

            if (!success)
            {
                Console.WriteLine("Authentication failed!");
                return;
            }
            Console.WriteLine(authenticator.XToken);
            Console.WriteLine(authenticator.UserInformation);
        }
예제 #18
0
        public async Task <ActionResult> Login(LoginViewModel model, string returnUrl)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            // Check if we need to login user locally (in case no SAML Identity Provider is registered for specified email domain)
            var emailDomain = Utils.GetEmailDomain(model.Email);
            var isSamlAuthenticationRequired =
                SamlIdentityProvidersRepository.IsSamlAuthenticationRequired(emailDomain);

            if (isSamlAuthenticationRequired)
            {
                return(RedirectToAction("Login", "SAML", new { domain = emailDomain, returnUrl = returnUrl }));
            }

            // Authenticate locally
            var succeeded = _authenticationService.Authenticate(AuthenticationType.Local, model.Email, model.Password);

            if (succeeded)
            {
                return(RedirectToLocal(returnUrl));
            }

            ModelState.AddModelError("", "Invalid login attempt.");

            return(View(model));
        }
예제 #19
0
 private async void SignIn()
 {
     if (String.IsNullOrWhiteSpace(Login) || String.IsNullOrWhiteSpace(Password))
     {
         MessageBox.Show("Login or password is empty");
     }
     else
     {
         var  authService = new AuthenticationService();
         User user        = null;
         try
         {
             IsEnabled = false;
             user      = await Task.Run(() => authService.Authenticate(_authUser));
         }
         catch (Exception ex)
         {
             MessageBox.Show($"Sign in failed {ex.Message}");
             return;
         }
         finally // is done independently from exception
         {
             IsEnabled = true;
         }
         MessageBox.Show($"Sign in was successful for user {user.FirstName} {user.LastName}");
         _gotoWalletsView.Invoke();
         WalletsViewModel.UpdateWalletsCollection(); // here collection of wallets for concrete user is updated because constuctor does it only one time
     }
 }
        public async Task <JwtToken> Authenticate(string login, string senha)
        {
            var user = await _authenticationService.Authenticate(new AuthenticateUser(login, senha));

            if (user == null)
            {
                return(null);
            }

            var claims = GetClaims(user);

            var JwtSecurityToken = new JwtSecurityToken(
                _tokenOptions.Issuer,
                _tokenOptions.Audience,
                claims,
                _tokenOptions.NotBefore,
                _tokenOptions.Expiration,
                _tokenOptions.SigningCredentials);

            var encodedJwt = new JwtSecurityTokenHandler().WriteToken(JwtSecurityToken);

            return(new JwtToken
            {
                Token = encodedJwt,
                Expires = (int)_tokenOptions.ValidFor.TotalSeconds,
                User = new UserModel
                {
                    Id = user.Id,
                    Email = user.Email,
                    Name = user.Name,
                    Username = user.Login
                }
            });
        }
예제 #21
0
        public async Task VerifyAuthenticateAndDeauthenticateInvokesEvents()
        {
            var myself = new PersonDto
            {
                Id        = 1,
                Email     = "email",
                FirstName = "firstname",
                LastName  = "lastname"
            };

            var authApi       = new Mock <IAuthenticationApi>();
            var personService = new Mock <IPersonService>();

            authApi.Setup(api => api.Authenticate(It.IsAny <AuthenticateCommand>()))
            .ReturnsAsync(new AuthTokenDto {
                Person = myself
            });
            var authService = new AuthenticationService(authApi.Object, personService.Object);
            int changed     = 0;

            authService.AuthChanged += (sender, model) => changed++;

            await authService.Authenticate("email", "password");

            changed.ShouldBe(1);
            authService.LoggedOnAccount.ShouldNotBeNull();

            changed = 0;

            await authService.Deauthenticate();

            changed.ShouldBe(1);
            authService.LoggedOnAccount.ShouldBeNull();
        }
 /// <summary>
 /// Triggers authentication if automatic authentication is enabled and an authentication service exists.
 /// </summary>
 protected virtual void TriggerAutomaticAuthentication()
 {
     if (AutomaticAuthentication)
     {
         AuthenticationService?.Authenticate();
     }
 }
예제 #23
0
        public async Task VerifyAuthenticateAndDeauthenticateCallsApis()
        {
            var myself = new PersonDto
            {
                Id        = 1,
                Email     = "email",
                FirstName = "firstname",
                LastName  = "lastname"
            };

            var authApi       = new Mock <IAuthenticationApi>();
            var personService = new Mock <IPersonService>();

            authApi.Setup(api => api.Authenticate(It.IsAny <AuthenticateCommand>()))
            .ReturnsAsync(new AuthTokenDto {
                Person = myself
            });
            var authService = new AuthenticationService(authApi.Object, personService.Object);

            await authService.Authenticate("email", "password");

            authApi.Verify(api => api.Authenticate(It.IsAny <AuthenticateCommand>()), Times.Once);
            authService.LoggedOnAccount.ShouldNotBeNull();
            authService.LoggedOnAccount.Person.ShouldBe(myself);
            authService.LoggedOnAccount.ShouldNotBeNull();

            await authService.Deauthenticate();

            authApi.Verify(api => api.Deauthenticate(), Times.Once);
            authService.LoggedOnAccount.ShouldBeNull();
        }
        public void Throws_When_Username_Is_Invalid(string testUserName)
        {
            var firstName = "FirstName";
            var lastName  = "LastName";
            var email     = "*****@*****.**";
            var userName  = testUserName;
            var password  = "******";

            var requestProviderResult = new AuthenticationResponse()
            {
                User = new User()
                {
                    FirstName = firstName,
                    LastName  = lastName,
                    Email     = email,
                    UserName  = userName
                }
                ,
                IsAuthenticated = true
            };

            var requestProviderMock = new Mock <IRequestProvider>();

            requestProviderMock
            .Setup(e => e.PostAsync <AuthenticationRequest, AuthenticationResponse>(It.IsAny <string>(), It.IsAny <AuthenticationRequest>(), It.IsAny <string>()))
            .Returns(Task.FromResult <AuthenticationResponse>(requestProviderResult));

            var settingsMock          = new Mock <ISettingsService>();
            var authenticationService = new AuthenticationService(requestProviderMock.Object, settingsMock.Object);


            Assert.ThrowsAsync <AuthenticationDataException>(
                async() => await authenticationService.Authenticate(userName, password));
        }
예제 #25
0
        protected void LoginButton_Click(object sender, EventArgs e)
        {
            var login    = this.loginInput.Value;
            var password = this.passwordInput.Value;

            var service = new AuthenticationService();
            var authenticateResponse = service.Authenticate(login, password);

            if (authenticateResponse.ChecksumErrors.Any())
            {
                Session.Add("UserId", authenticateResponse.UserId);
                const string checksumErrorsFormat = "Atención. Se encontraron {0} errores en dígitos verificadores.";
                this.lblError.Text    = String.Format(checksumErrorsFormat, authenticateResponse.ChecksumErrors.Count());
                this.lblError.Visible = true;

                if (this.Master is SiteMaster master)
                {
                    master.SetupSessionService();
                    master.SetupMenuVisibility();
                }
            }
            else if (authenticateResponse.Authenticated)
            {
                this.lblError.Visible = false;
                Session.Add("UserId", authenticateResponse.UserId);
                Session.Add("UserName", login);
                Response.Redirect("Default.aspx");
            }
            else
            {
                this.lblError.Text    = authenticateResponse.ValidationError;
                this.lblError.Visible = true;
            }
        }
#pragma warning disable 1998
        public override async Task <CommandResult> ExecuteAsync(CancellationToken cancel)
        {
            string authUrl = AuthenticationService.GetWindowsLiveAuthenticationUrl();

            Console.WriteLine($"Go to following URL and authenticate: {authUrl}");
            Console.WriteLine("Paste the returned URL and press ENTER: ");

            string redirectUrl = Console.ReadLine();

            try
            {
                WindowsLiveResponse response = AuthenticationService
                                               .ParseWindowsLiveResponse(redirectUrl);

                AuthenticationService authService = new AuthenticationService(response);

                authService.Authenticate();

                using (FileStream fs = File.Open(TokenFilePath, FileMode.Create))
                {
                    authService.DumpToFile(fs);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"Authentication failed! {e.Message}");
                return(CommandResult.RuntimeFailure);
            }

            Console.WriteLine($"Authentication succeeded, tokens saved to {TokenFilePath}");
            return(CommandResult.Success);
        }
예제 #27
0
        public void WhenUserIsDisabled_ShouldReturnFalse()
        {
            //Arrange
            var mockUnitOfWork = new Mock <IUnitOfWork>();

            mockUnitOfWork
            .Setup(moq => moq.RepositoryBase.FirstOrDefault <User>(
                       It.IsAny <Expression <Func <User, bool> > >(),
                       It.IsAny <Func <IQueryable <User>, IOrderedQueryable <User> > >()))
            .Returns(new User()
            {
                Password = "", Status = false
            });

            var mockCryptService = new Mock <ICryptService>();

            mockCryptService
            .Setup(moq => moq.IsValid(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(true);

            var mockAuthenticationTokenService = new Mock <IAuthenticationTokenService>();

            //Act
            var service = new AuthenticationService(mockUnitOfWork.Object, mockCryptService.Object,
                                                    mockAuthenticationTokenService.Object);
            var result = service.Authenticate("", "");

            //Assert
            Assert.NotNull(result);
            Assert.False(result.Status);
            Assert.Equal("Usuário desativado.", result.Message);
        }
예제 #28
0
 public void should_successfully_authenticate_with_correct_credentials()
 {
     var authenticationService = new AuthenticationService(_userRepository, new UserCreateService(_userRepository));
     var result = authenticationService.Authenticate(Username, Password);
     result.ShouldNotBeNull();
     result.Username.ToString().ShouldEqual(Username);
     result.IsAdministrator.ShouldBeTrue();
 }
예제 #29
0
        public void Authenticate_should_deny_user_without_registered_email_address()
        {
            CreateServices();
            PasswordHashService.Stub(o => o.HashSaltAndPassword("salt", "secret")).Return("$%^UW");
            AuthenticationResult result = AuthenticationService.Authenticate("*****@*****.**", "secret");

            result.IsError.Should().Be.True();
        }
예제 #30
0
 public string DoSomething()
 {
     if (_auth.Authenticate())
     {
         _count++;
     }
     return(count.ToString());
 }
        public async Task Authenticate_WhenUnsuccessfulResponseCode_ThrowsException()
        {
            string                invalidEndpoint       = baseUrl + "InvalidURL/";
            RestClient            client                = new RestClient(mockTokenProvider.Object);
            AuthenticationService authenticationService = new AuthenticationService(client, new EndpointResolver(invalidEndpoint));

            Token token = await authenticationService.Authenticate("arodriguez", "admin123$");
        }
        public void CanAuthenticateWithValidCredentials()
        {
            var token = AuthenticationService.Authenticate(Constants.Username, Constants.Password);

            Assert.IsNotNull(token);
            Assert.IsNotNull(token.Guid);
            Assert.AreNotEqual(Guid.Empty, token.Guid);
        }
예제 #33
0
        public async void Authenticate_WhenCalled_PublishesAuthenticationEvent()
        {
            //Arrange
            var service = new AuthenticationService();
            var eventAggregator = Mock.Create<IEventAggregator>();
            Mock.Arrange(() => eventAggregator.Publish(Arg.IsAny<AuthenticationEvent>())).MustBeCalled();
            service.TheEventAggregator = eventAggregator;

            //Act
            await service.Authenticate("UserName");


            //Assert
            Mock.Assert(service);
        }
		public Exception Authenticate(string userName, string userPassword, bool isIntegrated, string processPath)
		{
			
			try
			{
				var wse = new AuthenticationService();

				wse.Credentials = GetCredentials(isIntegrated, userName, userPassword);
				wse.Url = processPath + "Services/AuthenticationService.asmx";
				if (isIntegrated && string.IsNullOrEmpty(userPassword))
					userPassword = DEFAULT_PASSWORD_TEMPLATE;
				TpServicePolicy.ApplyAutheticationTicket(wse, userName, userPassword);
				wse.Authenticate();
			}
			catch (Exception exception)
			{
				return exception;
			}

			return null;
		}
예제 #35
0
 public void should_fail_to_authenticate_with_incorrect_credentials()
 {
     var authenticationService = new AuthenticationService(_userRepository, new UserCreateService(_userRepository));
     authenticationService.Authenticate(Username, "yada").ShouldBeNull();
 }