public boolean checkPassword(final String iPassword) { return OSecurityManager.instance().checkPassword(iPassword, (String) document.field(PASSWORD_FIELD)); }
public boolean checkPassword(final String iPassword) { return OSecurityManager.instance().checkPassword(iPassword, getPassword()); }
public OUser authenticate(final String username, final String password) { if (delegate == null) throw new OSecurityAccessException("OSymmetricKeySecurity.authenticate() Delegate is null for username: " + username); if (database == null) throw new OSecurityAccessException("OSymmetricKeySecurity.authenticate() Database is null for username: " + username); final String dbName = database.getName(); OUser user = delegate.getUser(username); if (user == null) throw new OSecurityAccessException(dbName, "OSymmetricKeySecurity.authenticate() Username or Key is invalid for username: " + username); if (user.getAccountStatus() != OSecurityUser.STATUSES.ACTIVE) throw new OSecurityAccessException(dbName, "OSymmetricKeySecurity.authenticate() User '" + username + "' is not active"); try { OUserSymmetricKeyConfig userConfig = new OUserSymmetricKeyConfig(user); OSymmetricKey sk = OSymmetricKey.fromConfig(userConfig); String decryptedUsername = sk.decryptAsString(password); if (OSecurityManager.instance().checkPassword(username, decryptedUsername)) return user; } catch (Exception ex) { throw OException.wrapException(new OSecurityAccessException(dbName, "OSymmetricKeySecurity.authenticate() Exception for database: " + dbName + ", username: " + username + " " + ex .getMessage()), ex); } throw new OSecurityAccessException(dbName, "OSymmetricKeySecurity.authenticate() Username or Key is invalid for database: " + dbName + ", username: " + username); }