File tree Expand file tree Collapse file tree
src/powerpwn/powerdump/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,13 @@ def acquire_token(scope: str, tenant: Optional[str] = None) -> str:
4343 )
4444 )
4545
46- bearer = azure_cli_bearer_tokens_for_scope .get ("token_type" ) + " " + azure_cli_bearer_tokens_for_scope .get ("access_token" )
46+ if "token_type" not in azure_cli_bearer_tokens_for_scope or "access_token" not in azure_cli_bearer_tokens_for_scope :
47+ logger .debug (
48+ f"Acquired a token package with scope={ scope } , tenant={ tenant } . Received the following keys: { list (azure_cli_bearer_tokens_for_scope .key ())} ."
49+ )
50+ raise RuntimeError (f"Something went wrong when trying to fetch tokens with scope={ scope } , tenant={ tenant } . Try removing cached credentials." )
51+
52+ bearer = azure_cli_bearer_tokens_for_scope ["token_type" ] + " " + azure_cli_bearer_tokens_for_scope ["access_token" ]
4753 logger .info (f"Access token for { scope } acquired successfully" )
4854
4955 # cache refresh token for cli to use in further FOCI authentication
You can’t perform that action at this time.
0 commit comments