Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Features Added

- Added Windows Web Account Manager (WAM) Brokered Authentication support. ([#23687](https://github.com/Azure/azure-sdk-for-python/issues/23687))

### Breaking Changes

### Bugs Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class InteractiveBrowserCredential(InteractiveCredential):
will cache tokens in memory.
:paramtype cache_persistence_options: ~azure.identity.TokenCachePersistenceOptions
:keyword int timeout: seconds to wait for the user to complete authentication. Defaults to 300 (5 minutes).
:keyword bool allow_broker: Brokers provide single sign-on, device identification, and application identification
verification. If this parameter is set to True, the broker will be used when possible. Defaults to False.
Comment thread
xiangyan99 marked this conversation as resolved.
Check https://learn.microsoft.com/azure/active-directory/develop/scenario-desktop-acquire-token-wam
for more WAM information.
:raises ValueError: invalid **redirect_uri**
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def __init__(
client_credential = get_client_credential(certificate_path, **kwargs)

super(CertificateCredential, self).__init__(
client_id=client_id, client_credential=client_credential, tenant_id=tenant_id, **kwargs
client_id=client_id,
client_credential=client_credential,
tenant_id=tenant_id,
**kwargs
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ def __init__(
)

super(ClientSecretCredential, self).__init__(
client_id=client_id, client_credential=client_secret, tenant_id=tenant_id, **kwargs
client_id=client_id,
client_credential=client_secret,
tenant_id=tenant_id,
**kwargs
)
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def __init__(
else:
raise TypeError('Either "client_certificate" or "client_secret" must be provided')

super(OnBehalfOfCredential, self).__init__(client_id, credential, tenant_id=tenant_id, **kwargs)
super(OnBehalfOfCredential, self).__init__(
client_id=client_id,
client_credential=credential,
tenant_id=tenant_id,
**kwargs)
self._auth_record = None # type: Optional[AuthenticationRecord]

@wrap_exceptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class UsernamePasswordCredential(InteractiveCredential):
:keyword cache_persistence_options: Configuration for persistent token caching. If unspecified, the credential
will cache tokens in memory.
:paramtype cache_persistence_options: ~azure.identity.TokenCachePersistenceOptions
:keyword bool allow_broker: Brokers provide single sign-on, device identification, and application identification
verification. If this parameter is set to True, the broker will be used when possible. Defaults to False.
Check https://learn.microsoft.com/azure/active-directory/develop/scenario-desktop-acquire-token-wam
for more WAM information.
:keyword List[str] additionally_allowed_tenants: Specifies tenants in addition to the specified "tenant_id"
for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to
acquire tokens for any tenant the application can access.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(
client_credential: Union[str, Dict] = None,
*,
additionally_allowed_tenants: List[str] = None,
allow_broker: bool = None,
**kwargs
) -> None:
authority = kwargs.pop("authority", None)
Expand All @@ -34,6 +35,7 @@ def __init__(
self._client_applications = {} # type: Dict[str, msal.ClientApplication]
self._client_credential = client_credential
self._client_id = client_id
self._allow_broker = allow_broker
self._additionally_allowed_tenants = additionally_allowed_tenants or []

self._cache = kwargs.pop("_cache", None)
Expand Down Expand Up @@ -76,7 +78,8 @@ def _get_app(self, **kwargs):
azure_region=self._regional_authority,
token_cache=self._cache,
http_client=self._client,
# validate_authority=self._validate_authority
# validate_authority=self._validate_authority,
allow_broker=self._allow_broker
)

return self._client_applications[tenant_id]