Commit 82434fba47c02f45366ead95ee4508a6662a4a48

Authored by Dancovich
2 parents 5e4c7bab 6a01c640
Exists in master

Merge branch 'master' of https://github.com/demoiselle/framework.git

impl/extension/servlet/src/main/java/br/gov/frameworkdemoiselle/security/ServletAuthenticator.java
... ... @@ -63,14 +63,14 @@ public class ServletAuthenticator implements Authenticator {
63 63 private static ResourceBundle bundle;
64 64  
65 65 @Override
66   - public void authenticate() throws AuthenticationException {
  66 + public void authenticate() throws Exception {
67 67 try {
68 68 getRequest().login(getCredentials().getUsername(), getCredentials().getPassword());
69 69  
70 70 } catch (ServletException cause) {
71 71 if (cause.getMessage().toLowerCase().contains("invalid")
72 72 || cause.getMessage().toLowerCase().contains("incorrect")
73   - || cause.getMessage().toLowerCase().contains("failed") ) {
  73 + || cause.getMessage().toLowerCase().contains("failed")) {
74 74 throw new InvalidCredentialsException(getBundle().getString("invalid-credentials"));
75 75 } else {
76 76 throw new AuthenticationException(getBundle().getString("authentication-failed"), cause);
... ... @@ -79,7 +79,7 @@ public class ServletAuthenticator implements Authenticator {
79 79 }
80 80  
81 81 @Override
82   - public void unauthenticate() {
  82 + public void unauthenticate() throws Exception {
83 83 getCredentials().clear();
84 84 try {
85 85 getRequest().logout();
... ...
impl/extension/servlet/src/main/java/br/gov/frameworkdemoiselle/security/ServletAuthorizer.java
... ... @@ -61,12 +61,12 @@ public class ServletAuthorizer implements Authorizer {
61 61 private transient ResourceBundle bundle;
62 62  
63 63 @Override
64   - public boolean hasRole(String role) {
  64 + public boolean hasRole(String role) throws Exception {
65 65 return getRequest().isUserInRole(role);
66 66 }
67 67  
68 68 @Override
69   - public boolean hasPermission(String resource, String operation) {
  69 + public boolean hasPermission(String resource, String operation) throws Exception {
70 70 throw new DemoiselleException(getBundle().getString("has-permission-not-supported",
71 71 RequiredPermission.class.getSimpleName()));
72 72 }
... ...