Skip to content

Commit c4dbf5f

Browse files
authored
Merge branch 'main' into axsuarez/remove-mention-fix
2 parents e0d0064 + bd5662a commit c4dbf5f

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

libraries/botframework-connector/botframework/connector/auth/certificate_app_credentials.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,17 @@ def get_access_token(self, force_refresh: bool = False) -> str:
6767
if not auth_token:
6868
# No suitable token exists in cache. Let's get a new one from AAD.
6969
auth_token = self.__get_msal_app().acquire_token_for_client(scopes=scopes)
70-
return auth_token["access_token"]
70+
if "access_token" in auth_token:
71+
return auth_token["access_token"]
72+
error = auth_token["error"] if "error" in auth_token else "Unknown error"
73+
error_description = (
74+
auth_token["error_description"]
75+
if "error_description" in auth_token
76+
else "Unknown error description"
77+
)
78+
raise PermissionError(
79+
f"Failed to get access token with error: {error}, error_description: {error_description}"
80+
)
7181

7282
def __get_msal_app(self):
7383
if not self.app:

libraries/botframework-connector/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ botbuilder-schema==4.17.0
33
requests==2.32.0
44
PyJWT==2.4.0
55
cryptography==43.0.1
6-
msal>=1.29.0
6+
msal>=1.31.1

libraries/botframework-connector/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# "requests>=2.23.0,<2.26",
1212
"PyJWT>=2.4.0",
1313
"botbuilder-schema==4.17.0",
14-
"msal>=1.29.0",
14+
"msal>=1.31.1",
1515
]
1616

1717
root = os.path.abspath(os.path.dirname(__file__))

0 commit comments

Comments
 (0)