Skip to content

Commit 2333d0a

Browse files
committed
Merge branch 'mi' into dev
2 parents 12566ba + c828a0f commit 2333d0a

9 files changed

+1075
-60
lines changed

docs/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,23 @@ You may want to catch them to provide a better error message to your end users.
168168

169169
.. autoclass:: msal.IdTokenError
170170

171+
172+
Managed Identity
173+
================
174+
MSAL supports
175+
`Managed Identity <https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview>`_.
176+
177+
You can create one of these two kinds of managed identity configuration objects:
178+
179+
.. autoclass:: msal.SystemAssignedManagedIdentity
180+
:members:
181+
182+
.. autoclass:: msal.UserAssignedManagedIdentity
183+
:members:
184+
185+
And then feed the configuration object into a :class:`ManagedIdentityClient` object.
186+
187+
.. autoclass:: msal.ManagedIdentityClient
188+
:members:
189+
190+
.. automethod:: __init__

msal/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@
3434
from .oauth2cli.oidc import Prompt, IdTokenError
3535
from .token_cache import TokenCache, SerializableTokenCache
3636
from .auth_scheme import PopAuthScheme
37+
from .managed_identity import (
38+
SystemAssignedManagedIdentity, UserAssignedManagedIdentity,
39+
ManagedIdentityClient,
40+
ManagedIdentityError,
41+
ArcPlatformNotSupportedError,
42+
)
3743

3844
# Putting module-level exceptions into the package namespace, to make them
3945
# 1. officially part of the MSAL public API, and
4046
# 2. can still be caught by the user code even if we change the module structure.
4147
from .oauth2cli.oauth2 import BrowserInteractionTimeoutError
48+

msal/application.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,11 @@ def __init__(
537537
self.http_client.mount("https://", a)
538538
self.http_client = ThrottledHttpClient(
539539
self.http_client,
540-
{} if http_cache is None else http_cache, # Default to an in-memory dict
540+
http_cache=http_cache,
541+
default_throttle_time=60
542+
# The default value 60 was recommended mainly for PCA at the end of
543+
# https://identitydivision.visualstudio.com/devex/_git/AuthLibrariesApiReview?version=GBdev&path=%2FService%20protection%2FIntial%20set%20of%20protection%20measures.md&_a=preview
544+
if isinstance(self, PublicClientApplication) else 5,
541545
)
542546

543547
self.app_name = app_name

0 commit comments

Comments
 (0)