Skip to content

Commit 562d72e

Browse files
Ugonnaak1bgavrilMS
andauthored
ROPC deprecation (#855)
* ROPC deprecation * sample edit * reenable e2e tests * reenable tests * edit * remove import * fix wording Co-authored-by: Bogdan Gavril <[email protected]> * edits * add comment * format * docstring changes --------- Co-authored-by: Bogdan Gavril <[email protected]>
1 parent f803aec commit 562d72e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

msal/application.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,17 @@ def acquire_token_by_username_password(
18401840
18411841
- A successful response would contain "access_token" key,
18421842
- an error response would contain "error" and usually "error_description".
1843+
1844+
[Deprecated] This API is deprecated for public client flows and will be
1845+
removed in a future release. Use a more secure flow instead.
1846+
Migration guide: https://aka.ms/msal-ropc-migration
1847+
18431848
"""
1849+
is_confidential_app = self.client_credential or isinstance(
1850+
self, ConfidentialClientApplication)
1851+
if not is_confidential_app:
1852+
warnings.warn("""This API has been deprecated for public client flows, please use a more secure flow.
1853+
See https://aka.ms/msal-ropc-migration for migration guidance""", DeprecationWarning)
18441854
claims = _merge_claims_challenge_and_capabilities(
18451855
self._client_capabilities, claims_challenge)
18461856
if self._enable_broker and sys.platform in ("win32", "darwin"):

0 commit comments

Comments
 (0)