Skip to content

Commit

Permalink
Merge pull request #146 from zonwizard/fix-credential-provider
Browse files Browse the repository at this point in the history
Use FromEnvCredentialProvider only if all required credentials are present in env
  • Loading branch information
denisneuf authored May 14, 2023
2 parents 8f61f42 + fe94bc2 commit 7e6768f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ad_api/base/credential_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ def __init__(

client_id_env = self._get_env('AD_API_CLIENT_ID'),
client_secret_env = self._get_env('AD_API_CLIENT_SECRET')
refresh_token_env = self._get_env('AD_API_REFRESH_TOKEN')
profile_id_env = self._get_env('AD_API_PROFILE_ID')

if client_id_env is not None and client_secret_env is not None:
if client_id_env is not None and client_secret_env is not None and refresh_token_env is not None and profile_id_env is not None:

try:
self.credentials = FromEnvCredentialProvider().load_credentials()
Expand Down

0 comments on commit 7e6768f

Please sign in to comment.