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) {
        
        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.
This will authenticate username using the system database .