server/src/main/java/com/orientechnologies/orient/server/security/authenticator/OSystemUserAuthenticator.java
public String authenticate(final String username, final String password) {
    String principal = null;

    try {
      if (getServer() != null) {
        // dbName parameter is null because we don't need to filter any roles for this.
        OUser user = getServer().getSecurity().getSystemUser(username, null);

        if (user != null && user.getAccountStatus() == OSecurityUser.STATUSES.ACTIVE) {
          if (user.checkPassword(password))
            principal = username;
        }
      }
    } catch (Exception ex) {
      OLogManager.instance().error(this, "authenticate()", ex);
    }

    return principal;
  }
public String authenticate(final String username, final String password) {
    String principal = null;

    try {
      if (getServer() != null) {
        // dbName parameter is null because we don't need to filter any roles for this.
        OUser user = getServer().getSecurity().getSystemUser(username, null);

        if (user != null && user.getAccountStatus() == OSecurityUser.STATUSES.ACTIVE) {
          if (user.checkPassword(password))
            principal = username;
        }
      }
    } catch (Exception ex) {
      OLogManager.instance().error(this, "authenticate()", ex);
    }

    return principal;
  }
This will authenticate username using the system database.