Improve error handling
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 12 Feb 2015 15:03:17 +0000 (15:03 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 12 Feb 2015 15:03:17 +0000 (15:03 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@7818 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.security.core/src/org/argeo/security/jcr/jackrabbit/JackrabbitUserAdminService.java

index fde3d850fcfb34b94ffcd3eabdbbd1af96d7251d..711c9d598e031f50069bd624bface214fac2638c 100644 (file)
@@ -302,6 +302,8 @@ public class JackrabbitUserAdminService implements UserAdminService,
                        Authentication authentication) throws AuthenticationException {
                UsernamePasswordAuthenticationToken siteAuth = (UsernamePasswordAuthenticationToken) authentication;
                String username = siteAuth.getName();
+               if (!(siteAuth.getCredentials() instanceof char[]))
+                       throw new ArgeoException("Only char array passwords are supported");
                char[] password = (char[]) siteAuth.getCredentials();
                try {
                        SimpleCredentials sp = new SimpleCredentials(siteAuth.getName(),