Refactor required authentication info check

The client_secret is unnecessary for RSA-based authentication, so don't require it.
if not app_key