use of com.enonic.xp.security.auth.EmailPasswordAuthToken in project xp by enonic.
the class SecurityServiceImplTest method testAuthenticateByEmailPwdWrongPwd.
@Test
public void testAuthenticateByEmailPwdWrongPwd() throws Exception {
runAsAdmin(() -> {
final CreateUserParams createUser = CreateUserParams.create().userKey(PrincipalKey.ofUser(SYSTEM, "User1")).displayName("User 1").email("user1@enonic.com").login("User1").password("fisk").build();
securityService.createUser(createUser);
refresh();
final EmailPasswordAuthToken authToken = new EmailPasswordAuthToken();
authToken.setEmail("user1@enonic.com");
authToken.setPassword("password");
authToken.setIdProvider(SYSTEM);
final AuthenticationInfo authInfo = securityService.authenticate(authToken);
assertFalse(authInfo.isAuthenticated());
});
}
Aggregations