class OadrSecurityRoleService {

	public User grantDigestRole(String username, String password) {
		AbstractUser abstractUser = saveFindUser(username);
		if (!abstractUser.getDigestPassword().equals(password)) {
			throw new BadCredentialsException("Bad credentials given for user: '" + username + "'");
		}
		return this.grantRole(abstractUser, abstractUser.getDigestPassword());
	}

}