@@ -66,15 +66,23 @@ def __init__(self, config: Config):
6666 self ._token = None
6767
6868 # If provided, set a static token
69- if config .exists (ConfigOptions .ENABLE_AUTH_TOKEN ):
70- self ._static_token = config .get (ConfigOptions .ENABLE_AUTH_TOKEN )
69+ if (
70+ config .exists (ConfigOptions .AUTH_TOKEN )
71+ and config .get (ConfigOptions .AUTH_TOKEN ) != ""
72+ ):
73+ self ._static_token = config .get (ConfigOptions .AUTH_TOKEN )
7174 self ._refresh_token (config )
7275 elif (
7376 config .exists (ConfigOptions .OAUTH_GRANT_TYPE )
7477 and config .exists (ConfigOptions .OAUTH_CLIENT_ID )
7578 and config .exists (ConfigOptions .OAUTH_CLIENT_SECRET )
7679 and config .exists (ConfigOptions .OAUTH_AUDIENCE )
7780 and config .exists (ConfigOptions .OAUTH_TOKEN_REQUEST_URL )
81+ and config .get (ConfigOptions .OAUTH_GRANT_TYPE ) != ""
82+ and config .get (ConfigOptions .OAUTH_CLIENT_ID ) != ""
83+ and config .get (ConfigOptions .OAUTH_CLIENT_SECRET ) != ""
84+ and config .get (ConfigOptions .OAUTH_AUDIENCE ) != ""
85+ and config .get (ConfigOptions .OAUTH_TOKEN_REQUEST_URL ) != ""
7886 ):
7987 self ._refresh_token (config )
8088 else :
@@ -162,8 +170,11 @@ def __init__(self, config: Config):
162170 self ._token = None
163171
164172 # If provided, set a static token
165- if config .exists (ConfigOptions .ENABLE_AUTH_TOKEN ):
166- self ._static_token = config .get (ConfigOptions .ENABLE_AUTH_TOKEN )
173+ if (
174+ config .exists (ConfigOptions .AUTH_TOKEN )
175+ and config .get (ConfigOptions .AUTH_TOKEN ) != ""
176+ ):
177+ self ._static_token = config .get (ConfigOptions .AUTH_TOKEN )
167178
168179 self ._request = requests .Request ()
169180 self ._refresh_token ()
0 commit comments