You should use is when comparing to singletons rather than == though this would be cleaner with something like 

if not any([api_token, basic_auth])