Skip to content

Commit c1b3e60

Browse files
committed
deprecate api
1 parent d49296c commit c1b3e60

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

msal/application.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,11 @@ def acquire_token_by_username_password(
18151815
# because this ROPC won't work with MSA account anyway.
18161816
auth_scheme=None,
18171817
**kwargs):
1818-
"""Gets a token for a given resource via user credentials.
1818+
"""
1819+
[Deprecated] This API is deprecated and will be removed in a future release. Use a more secure flow instead.
1820+
Migration guide: https://aka.ms/msalnet-ropc-migration
1821+
1822+
Gets a token for a given resource via user credentials.
18191823
18201824
See this page for constraints of Username Password Flow.
18211825
https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Username-Password-Authentication
@@ -1841,6 +1845,7 @@ def acquire_token_by_username_password(
18411845
- A successful response would contain "access_token" key,
18421846
- an error response would contain "error" and usually "error_description".
18431847
"""
1848+
warnings.warn("This API has been deprecated, please use a more secure flow. See https://aka.ms/msal-ropc-migration for migration guidance", DeprecationWarning)
18441849
claims = _merge_claims_challenge_and_capabilities(
18451850
self._client_capabilities, claims_challenge)
18461851
if self._enable_broker and sys.platform in ("win32", "darwin"):

0 commit comments

Comments
 (0)