String oldCredential = (String)env.get(Context.SECURITY_CREDENTIALS);
String oldUsername = (String)env.get(Context.SECURITY_PRINCIPAL);
String dn = lookupByUid(uid);
if ( dn == null )
throw new SecurityException(new KeyedMessage("User " + uid + " not found"));
// Build user dn using lookup value, just appending the user filter after the uid won't work when users
// are/can be stored in a subtree (searchScope sub-tree)
// The looked up dn though is/should always be correct, just need to append the root context.
if (!StringUtils.isEmpty(getRootContext()))