microsoft-agents-authentication-msal 0.9.0.dev7__tar.gz → 0.9.0.dev9__tar.gz
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.
- {microsoft_agents_authentication_msal-0.9.0.dev7/microsoft_agents_authentication_msal.egg-info → microsoft_agents_authentication_msal-0.9.0.dev9}/PKG-INFO +2 -2
- microsoft_agents_authentication_msal-0.9.0.dev9/VERSION.txt +1 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/microsoft_agents/authentication/msal/msal_auth.py +29 -9
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9/microsoft_agents_authentication_msal.egg-info}/PKG-INFO +2 -2
- microsoft_agents_authentication_msal-0.9.0.dev9/microsoft_agents_authentication_msal.egg-info/requires.txt +3 -0
- microsoft_agents_authentication_msal-0.9.0.dev7/VERSION.txt +0 -1
- microsoft_agents_authentication_msal-0.9.0.dev7/microsoft_agents_authentication_msal.egg-info/requires.txt +0 -3
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/LICENSE +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/MANIFEST.in +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/microsoft_agents/authentication/msal/__init__.py +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/microsoft_agents/authentication/msal/errors/__init__.py +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/microsoft_agents/authentication/msal/errors/error_resources.py +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/microsoft_agents/authentication/msal/msal_connection_manager.py +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/microsoft_agents_authentication_msal.egg-info/SOURCES.txt +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/microsoft_agents_authentication_msal.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/microsoft_agents_authentication_msal.egg-info/top_level.txt +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/pyproject.toml +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/readme.md +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/setup.cfg +0 -0
- {microsoft_agents_authentication_msal-0.9.0.dev7 → microsoft_agents_authentication_msal-0.9.0.dev9}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-authentication-msal
|
|
3
|
-
Version: 0.9.0.
|
|
3
|
+
Version: 0.9.0.dev9
|
|
4
4
|
Summary: A msal-based authentication library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: microsoft-agents-hosting-core==0.9.0.
|
|
18
|
+
Requires-Dist: microsoft-agents-hosting-core==0.9.0.dev9
|
|
19
19
|
Requires-Dist: msal>=1.34.0
|
|
20
20
|
Requires-Dist: requests>=2.32.3
|
|
21
21
|
Dynamic: license-file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.9.0.dev9
|
|
@@ -42,8 +42,6 @@ async def _async_acquire_token_for_client(msal_auth_client, *args, **kwargs):
|
|
|
42
42
|
|
|
43
43
|
class MsalAuth(AccessTokenProviderBase):
|
|
44
44
|
|
|
45
|
-
_client_credential_cache = None
|
|
46
|
-
|
|
47
45
|
def __init__(self, msal_configuration: AgentAuthConfiguration):
|
|
48
46
|
"""Initializes the MsalAuth class with the given configuration.
|
|
49
47
|
|
|
@@ -211,16 +209,38 @@ class MsalAuth(AccessTokenProviderBase):
|
|
|
211
209
|
)
|
|
212
210
|
else:
|
|
213
211
|
authority = MsalAuth._resolve_authority(self._msal_configuration, tenant_id)
|
|
212
|
+
client_credential = None
|
|
214
213
|
|
|
215
|
-
if self.
|
|
216
|
-
|
|
217
|
-
pass
|
|
218
|
-
elif self._msal_configuration.AUTH_TYPE == AuthTypes.client_secret:
|
|
219
|
-
self._client_credential_cache = self._msal_configuration.CLIENT_SECRET
|
|
214
|
+
if self._msal_configuration.AUTH_TYPE == AuthTypes.client_secret:
|
|
215
|
+
client_credential = self._msal_configuration.CLIENT_SECRET
|
|
220
216
|
elif self._msal_configuration.AUTH_TYPE == AuthTypes.certificate:
|
|
221
|
-
|
|
217
|
+
client_credential = {
|
|
222
218
|
"private_key_pfx_path": self._msal_configuration.CERT_PFX_FILE,
|
|
223
219
|
}
|
|
220
|
+
elif self._msal_configuration.AUTH_TYPE == AuthTypes.federated_credentials:
|
|
221
|
+
mi_client = ManagedIdentityClient(
|
|
222
|
+
UserAssignedManagedIdentity(
|
|
223
|
+
client_id=self._msal_configuration.FEDERATED_CLIENT_ID
|
|
224
|
+
),
|
|
225
|
+
http_client=Session(),
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
def get_assertion() -> str:
|
|
229
|
+
result = mi_client.acquire_token_for_client(
|
|
230
|
+
resource="api://AzureADTokenExchange"
|
|
231
|
+
)
|
|
232
|
+
if "access_token" not in result:
|
|
233
|
+
logger.error(
|
|
234
|
+
f"Failed to acquire token for federated credentials: {result}"
|
|
235
|
+
)
|
|
236
|
+
raise ValueError(
|
|
237
|
+
authentication_errors.FailedToAcquireToken.format(
|
|
238
|
+
str(result)
|
|
239
|
+
)
|
|
240
|
+
)
|
|
241
|
+
return result["access_token"]
|
|
242
|
+
|
|
243
|
+
client_credential = {"client_assertion": get_assertion}
|
|
224
244
|
else:
|
|
225
245
|
logger.error(
|
|
226
246
|
f"Unsupported authentication type: {self._msal_configuration.AUTH_TYPE}"
|
|
@@ -232,7 +252,7 @@ class MsalAuth(AccessTokenProviderBase):
|
|
|
232
252
|
return ConfidentialClientApplication(
|
|
233
253
|
client_id=self._msal_configuration.CLIENT_ID,
|
|
234
254
|
authority=authority,
|
|
235
|
-
client_credential=
|
|
255
|
+
client_credential=client_credential,
|
|
236
256
|
)
|
|
237
257
|
|
|
238
258
|
def _client_rep(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-authentication-msal
|
|
3
|
-
Version: 0.9.0.
|
|
3
|
+
Version: 0.9.0.dev9
|
|
4
4
|
Summary: A msal-based authentication library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: microsoft-agents-hosting-core==0.9.0.
|
|
18
|
+
Requires-Dist: microsoft-agents-hosting-core==0.9.0.dev9
|
|
19
19
|
Requires-Dist: msal>=1.34.0
|
|
20
20
|
Requires-Dist: requests>=2.32.3
|
|
21
21
|
Dynamic: license-file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.9.0.dev7
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|