Commit 605c06cd9de881da4fa6b069b72ae81677f26130

Authored by Dancovich
2 parents 24af9b8a 79fdcb49
Exists in master

Merge remote-tracking branch 'origin/master'

impl/extension/servlet/src/main/java/br/gov/frameworkdemoiselle/security/ServletAuthenticator.java
... ... @@ -68,7 +68,8 @@ public class ServletAuthenticator implements Authenticator {
68 68 getRequest().login(getCredentials().getUsername(), getCredentials().getPassword());
69 69  
70 70 } catch (ServletException cause) {
71   - if (cause.getMessage().contains("invalid")) {
  71 + if (cause.getMessage().toLowerCase().contains("invalid")
  72 + || cause.getMessage().toLowerCase().contains("incorrect")) {
72 73 throw new InvalidCredentialsException(getBundle().getString("invalid-credentials"));
73 74 } else {
74 75 throw new AuthenticationException(getBundle().getString("authentication-failed"), cause);
... ...
impl/extension/servlet/src/test/java/security/authentication/form/ServletAuthenticatorTest.java
... ... @@ -23,8 +23,6 @@ import org.junit.runner.RunWith;
23 23  
24 24 import test.Tests;
25 25  
26   -import com.sun.enterprise.security.auth.login.FileLoginModule;
27   -
28 26 @RunWith(Arquillian.class)
29 27 public class ServletAuthenticatorTest {
30 28  
... ... @@ -35,7 +33,7 @@ public class ServletAuthenticatorTest {
35 33  
36 34 @Deployment(testable = false)
37 35 public static WebArchive createDeployment() {
38   - return Tests.createDeployment().addClasses(HelperServlet.class, FileLoginModule.class)
  36 + return Tests.createDeployment().addClasses(HelperServlet.class)
39 37 .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml");
40 38 }
41 39  
... ...