What if username or password are empty ? Does this function can handle it without throwing exceptions or anything else ? 
As the default behavior for many peaple is not have authentication.