Commit a14ff67971e42cba23d450381b31912fe53ac561
1 parent
62e45da7
Exists in
master
Ajustes para tratamento correto na detecção de falha na autenticação do
JAAS com Servlet
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
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); | ... | ... |