Only authenticate if username and password are present.