- // throw new FailedLoginException("Invalid credentials");
- if (!user.hasCredential(null, password))
+
+ // try bind first
+ try {
+ AuthenticatingUser authenticatingUser = new AuthenticatingUser(user.getName(), password);
+ bindAuthorization = userAdmin.getAuthorization(authenticatingUser);
+ // TODO check tokens as well
+ if (bindAuthorization != null)
+ return true;
+ } catch (Exception e) {
+ // silent
+ if(log.isTraceEnabled())
+ log.trace("Bind failed", e);
+ }
+
+ // works only if a connection password is provided
+ if (!user.hasCredential(null, password)) {