microsoft-agents-authentication-msal 0.1.2__py3-none-any.whl → 0.2.0.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,9 +80,18 @@ class MsalAuth(AccessTokenProviderBase):
80
80
  )
81
81
  elif isinstance(msal_auth_client, ConfidentialClientApplication):
82
82
  # TODO: Handling token error / acquisition failed
83
- return msal_auth_client.acquire_token_on_behalf_of(
83
+
84
+ token = msal_auth_client.acquire_token_on_behalf_of(
84
85
  user_assertion=user_assertion, scopes=scopes
85
- )["access_token"]
86
+ )
87
+
88
+ if "access_token" not in token:
89
+ logger.error(
90
+ f"Failed to acquire token on behalf of user: {user_assertion}"
91
+ )
92
+ raise ValueError(f"Failed to acquire token. {str(token)}")
93
+
94
+ return token["access_token"]
86
95
 
87
96
  logger.error(
88
97
  f"On-behalf-of flow is not supported with the current authentication type: {msal_auth_client.__class__.__name__}"
@@ -1,5 +1,5 @@
1
1
  from typing import Dict, List, Optional
2
- from microsoft.agents.hosting.core.authorization import (
2
+ from microsoft.agents.hosting.core import (
3
3
  AgentAuthConfiguration,
4
4
  AccessTokenProviderBase,
5
5
  ClaimsIdentity,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-authentication-msal
3
- Version: 0.1.2
3
+ Version: 0.2.0.dev1
4
4
  Summary: A msal-based authentication library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  Project-URL: Homepage, https://github.com/microsoft/Agents
@@ -8,7 +8,7 @@ Classifier: Programming Language :: Python :: 3
8
8
  Classifier: License :: OSI Approved :: MIT License
9
9
  Classifier: Operating System :: OS Independent
10
10
  Requires-Python: >=3.9
11
- Requires-Dist: microsoft-agents-hosting-core==0.1.2
11
+ Requires-Dist: microsoft-agents-hosting-core==0.2.0.dev1
12
12
  Requires-Dist: msal>=1.31.1
13
13
  Requires-Dist: requests>=2.32.3
14
14
  Requires-Dist: cryptography>=44.0.0
@@ -0,0 +1,7 @@
1
+ microsoft/agents/authentication/msal/__init__.py,sha256=hjPpakL4zyqeCTEBOUCcHaRnSpG80q-L0csG5HMalYI,151
2
+ microsoft/agents/authentication/msal/msal_auth.py,sha256=_NUJFKYAsuH1JFf3qh6GV_eTkJ1dBRmmmvirdl7esWQ,7518
3
+ microsoft/agents/authentication/msal/msal_connection_manager.py,sha256=1jBcvnC9vEAqdxYxuN4_sxONZYPurBzkeqrkFjr07UU,2723
4
+ microsoft_agents_authentication_msal-0.2.0.dev1.dist-info/METADATA,sha256=K0n3y6uaVFuMCWi-EWvcd3HptW5YRLCbidYdzRLgAHs,585
5
+ microsoft_agents_authentication_msal-0.2.0.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ microsoft_agents_authentication_msal-0.2.0.dev1.dist-info/top_level.txt,sha256=egwWDmpnNBTGerc55Oa6VVW9hTKdtxFjHWHywqmVMpM,10
7
+ microsoft_agents_authentication_msal-0.2.0.dev1.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- microsoft/agents/authentication/msal/__init__.py,sha256=hjPpakL4zyqeCTEBOUCcHaRnSpG80q-L0csG5HMalYI,151
2
- microsoft/agents/authentication/msal/msal_auth.py,sha256=iUZNBmQeBosqxkRXmrcOCVINHvvND2ZpsMCKqmd69Mk,7239
3
- microsoft/agents/authentication/msal/msal_connection_manager.py,sha256=vrLtAVXIwfBr42upnzouEhoen8OVi3f4-Jqxt3aNY4A,2737
4
- microsoft_agents_authentication_msal-0.1.2.dist-info/METADATA,sha256=CQgNCOEKN9vCbx-Y7L5m1z-NDm-fsphXMUzRuv7XL-Y,575
5
- microsoft_agents_authentication_msal-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- microsoft_agents_authentication_msal-0.1.2.dist-info/top_level.txt,sha256=egwWDmpnNBTGerc55Oa6VVW9hTKdtxFjHWHywqmVMpM,10
7
- microsoft_agents_authentication_msal-0.1.2.dist-info/RECORD,,