added checkin for empty user and pwd fields
@@ -58,6 +58,7 @@ class MicrosoftAppCredentials(Authentication):
return basic_authentication.signed_session()
def get_access_token(self, force_refresh=False):
+ if self.microsoft_app_id and self.microsoft_app_password:
if not force_refresh:
# check the global cache for the token. If we have it, and it's valid, we're done.
oauth_token = MicrosoftAppCredentials.cache.get(self.token_cache_key, None)
@@ -72,6 +73,8 @@ class MicrosoftAppCredentials(Authentication):
oauth_token = self.refresh_token()
MicrosoftAppCredentials.cache.setdefault(self.token_cache_key, oauth_token)
return oauth_token.access_token
+ else:
+ return ''
def refresh_token(self):
options = {
