String password = deposit.getPassword();
if ((username != null) && (password != null) &&
(((username.equals("")) && (password.equals(""))) ||
(!username.equalsIgnoreCase(password))) ) {
// User not authenticated
throw new SWORDAuthenticationException("Bad credentials");
}
// Check this is a collection that takes obo deposits, else thrown an error
if (((deposit.getOnBehalfOf() != null) && (!deposit.getOnBehalfOf().equals(""))) &&
(!deposit.getLocation().contains("deposit?user="))) {