microsoft-agents-authentication-msal 1.6.1.dev3__tar.gz → 1.6.1.dev6__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-1.6.1.dev3/microsoft_agents_authentication_msal.egg-info → microsoft_agents_authentication_msal-1.6.1.dev6}/PKG-INFO +2 -2
- microsoft_agents_authentication_msal-1.6.1.dev6/VERSION.txt +1 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents/authentication/msal/msal_auth.py +15 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents/authentication/msal/msal_token_credential.py +7 -2
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6/microsoft_agents_authentication_msal.egg-info}/PKG-INFO +2 -2
- microsoft_agents_authentication_msal-1.6.1.dev6/microsoft_agents_authentication_msal.egg-info/requires.txt +4 -0
- microsoft_agents_authentication_msal-1.6.1.dev3/VERSION.txt +0 -1
- microsoft_agents_authentication_msal-1.6.1.dev3/microsoft_agents_authentication_msal.egg-info/requires.txt +0 -4
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/LICENSE +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/MANIFEST.in +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents/authentication/msal/__init__.py +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents/authentication/msal/errors/__init__.py +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents/authentication/msal/errors/error_resources.py +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents/authentication/msal/msal_connection_manager.py +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents/authentication/msal/py.typed +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents_authentication_msal.egg-info/SOURCES.txt +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents_authentication_msal.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/microsoft_agents_authentication_msal.egg-info/top_level.txt +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/pyproject.toml +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/readme.md +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/setup.cfg +0 -0
- {microsoft_agents_authentication_msal-1.6.1.dev3 → microsoft_agents_authentication_msal-1.6.1.dev6}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-authentication-msal
|
|
3
|
-
Version: 1.6.1.
|
|
3
|
+
Version: 1.6.1.dev6
|
|
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==1.6.1.
|
|
18
|
+
Requires-Dist: microsoft-agents-hosting-core==1.6.1.dev6
|
|
19
19
|
Requires-Dist: azure-core
|
|
20
20
|
Requires-Dist: msal>=1.34.0
|
|
21
21
|
Requires-Dist: requests>=2.32.3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.6.1.dev6
|
|
@@ -17,7 +17,10 @@ from msal import (
|
|
|
17
17
|
SystemAssignedManagedIdentity,
|
|
18
18
|
TokenCache,
|
|
19
19
|
)
|
|
20
|
+
|
|
20
21
|
from azure.core.credentials import AccessToken
|
|
22
|
+
from azure.core.credentials_async import AsyncTokenCredential
|
|
23
|
+
|
|
21
24
|
from requests import Session
|
|
22
25
|
|
|
23
26
|
from microsoft_agents.activity._utils import _DeferredString
|
|
@@ -86,6 +89,16 @@ class MsalAuth(AccessTokenProviderBase):
|
|
|
86
89
|
access_token = await self._get_access_token(resource_url, scopes, force_refresh)
|
|
87
90
|
return access_token.token
|
|
88
91
|
|
|
92
|
+
def get_token_credential(self) -> AsyncTokenCredential:
|
|
93
|
+
"""Gets the token credential for the access token provider.
|
|
94
|
+
|
|
95
|
+
:return: The token credential.
|
|
96
|
+
:rtype: AsyncTokenCredential
|
|
97
|
+
"""
|
|
98
|
+
from .msal_token_credential import MsalTokenCredential
|
|
99
|
+
|
|
100
|
+
return MsalTokenCredential(self._msal_configuration, provider=self)
|
|
101
|
+
|
|
89
102
|
async def _get_access_token(
|
|
90
103
|
self, resource_url: str, scopes: list[str], force_refresh: bool = False
|
|
91
104
|
) -> AccessToken:
|
|
@@ -293,6 +306,8 @@ class MsalAuth(AccessTokenProviderBase):
|
|
|
293
306
|
client_credential = {
|
|
294
307
|
"private_key_pfx_path": self._msal_configuration.CERT_PFX_FILE,
|
|
295
308
|
}
|
|
309
|
+
if self._msal_configuration.SEND_X5C:
|
|
310
|
+
client_credential["public_certificate"] = True
|
|
296
311
|
elif self._msal_configuration.AUTH_TYPE == AuthTypes.federated_credentials:
|
|
297
312
|
mi_client = ManagedIdentityClient(
|
|
298
313
|
UserAssignedManagedIdentity(
|
|
@@ -26,14 +26,19 @@ def _get_resource(scope: str) -> str:
|
|
|
26
26
|
class MsalTokenCredential(AsyncTokenCredential):
|
|
27
27
|
"""Provides an asynchronous Azure Core token credential using MSAL."""
|
|
28
28
|
|
|
29
|
-
def __init__(
|
|
29
|
+
def __init__(
|
|
30
|
+
self,
|
|
31
|
+
config: AgentAuthConfiguration,
|
|
32
|
+
*,
|
|
33
|
+
provider: MsalAuth | None = None,
|
|
34
|
+
):
|
|
30
35
|
"""Initializes the MsalTokenCredential with the given configuration.
|
|
31
36
|
|
|
32
37
|
:param config: The agent authentication configuration.
|
|
33
38
|
:type config: :class:`microsoft_agents.hosting.core.AgentAuthConfiguration`
|
|
34
39
|
"""
|
|
35
40
|
self._config = config
|
|
36
|
-
self._provider: MsalAuth | None =
|
|
41
|
+
self._provider: MsalAuth | None = provider
|
|
37
42
|
|
|
38
43
|
async def get_token(self, *scopes: str, **kwargs) -> AccessToken:
|
|
39
44
|
"""Acquire an access token for the specified scopes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-authentication-msal
|
|
3
|
-
Version: 1.6.1.
|
|
3
|
+
Version: 1.6.1.dev6
|
|
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==1.6.1.
|
|
18
|
+
Requires-Dist: microsoft-agents-hosting-core==1.6.1.dev6
|
|
19
19
|
Requires-Dist: azure-core
|
|
20
20
|
Requires-Dist: msal>=1.34.0
|
|
21
21
|
Requires-Dist: requests>=2.32.3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.6.1.dev3
|
|
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
|
|
File without changes
|