Skip to content

Commit 4798680

Browse files
committed
edits
1 parent 4b4c97e commit 4798680

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

msal/__main__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,7 @@ def _acquire_token_interactive(app, scopes=None, data=None):
149149
return result
150150

151151
def _acquire_token_by_username_password(app):
152-
"""
153-
[Deprecated] This API is deprecated for PublicClientApplication(PCA) flows and will be removed in a future release. Use a more secure flow instead.
154-
Migration guide: https://aka.ms/msal-ropc-migration
155-
156-
acquire_token_by_username_password() - See constraints here: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#constraints-for-ropc
157-
"""
152+
"""acquire_token_by_username_password() - See constraints here: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#constraints-for-ropc"""
158153
print_json(app.acquire_token_by_username_password(
159154
_input("username: "), getpass.getpass("password: "), scopes=_input_scopes()))
160155

msal/application.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,11 +1815,7 @@ def acquire_token_by_username_password(
18151815
# because this ROPC won't work with MSA account anyway.
18161816
auth_scheme=None,
18171817
**kwargs):
1818-
"""
1819-
[Deprecated] This API is deprecated for PublicClientApplication(PCA) flows and will be removed in a future release. Use a more secure flow instead.
1820-
Migration guide: https://aka.ms/msal-ropc-migration
1821-
1822-
Gets a token for a given resource via user credentials.
1818+
"""Gets a token for a given resource via user credentials.
18231819
18241820
See this page for constraints of Username Password Flow.
18251821
https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki/Username-Password-Authentication
@@ -1844,12 +1840,17 @@ def acquire_token_by_username_password(
18441840
18451841
- A successful response would contain "access_token" key,
18461842
- an error response would contain "error" and usually "error_description".
1843+
1844+
[Deprecated] This API is deprecated for public client flows and will be removed in a future release.
1845+
Use a more secure flow instead.
1846+
Migration guide: https://aka.ms/msal-ropc-migration
1847+
18471848
"""
18481849
is_confidential_app = self.client_credential or isinstance(
18491850
self, ConfidentialClientApplication)
18501851
if not is_confidential_app:
1851-
warnings.warn("This API has been deprecated for public client flows, please use a more secure flow. " \
1852-
"See https://aka.ms/msal-ropc-migration for migration guidance", DeprecationWarning)
1852+
warnings.warn("""This API has been deprecated, please use a more secure flow.
1853+
See https://aka.ms/msal-ropc-migration for migration guidance""", DeprecationWarning)
18531854
claims = _merge_claims_challenge_and_capabilities(
18541855
self._client_capabilities, claims_challenge)
18551856
if self._enable_broker and sys.platform in ("win32", "darwin"):

0 commit comments

Comments
 (0)