@Override public OUser getUser(final String username) { OUser user = null; if (Orient.instance().getSecurity() != null) { // See if there's a system user first. user = Orient.instance().getSecurity().getSystemUser(username, getDatabase().getName()); } // If not found, try the local database. if (user == null) user = super.getUser(username); return user; } }
String username = Orient.instance().getSecurity().authenticate(iUsername, iUserPassword); if(Orient.instance().getSecurity().isDefaultAllowed())
public static boolean encodePassword(final ODocument iDocument) { if (iDocument.field("name") == null) throw new OSecurityException("User name not found"); final String password = (String) iDocument.field("password"); if (password == null) throw new OSecurityException("User '" + iDocument.field("name") + "' has no password"); if (Orient.instance().getSecurity() != null) { Orient.instance().getSecurity().validatePassword(password); } if (!password.startsWith("{")) { iDocument.field("password", encryptPassword(password)); return true; } return false; }