attempt to generate an API key given a username/password, throw AuthenticationException when required