|
10 | 10 | Usage 2: Build an all-in-one executable file for bug bash. |
11 | 11 | shiv -e msal.__main__._main -o msaltest-on-os-name.pyz . |
12 | 12 | """ |
13 | | -import base64, getpass, json, logging, sys, os, atexit, msal |
| 13 | +import base64, getpass, json, logging, sys, os, atexit, msal, warnings |
14 | 14 |
|
15 | 15 | _token_cache_filename = "msal_cache.bin" |
16 | 16 | global_cache = msal.SerializableTokenCache() |
@@ -149,7 +149,13 @@ def _acquire_token_interactive(app, scopes=None, data=None): |
149 | 149 | return result |
150 | 150 |
|
151 | 151 | def _acquire_token_by_username_password(app): |
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""" |
| 152 | + """ |
| 153 | + [Deprecated] This API is deprecated 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 | + """ |
| 158 | + warnings.warn("This API has been deprecated, please use a more secure flow. See https://aka.ms/msal-ropc-migration for migration guidance", DeprecationWarning) |
153 | 159 | print_json(app.acquire_token_by_username_password( |
154 | 160 | _input("username: "), getpass.getpass("password: "), scopes=_input_scopes())) |
155 | 161 |
|
@@ -322,7 +328,6 @@ def _main(): |
322 | 328 | _acquire_pop_token_interactive, |
323 | 329 | ] if isinstance(app, msal.PublicClientApplication) else [] |
324 | 330 | ) + [ |
325 | | - _acquire_token_by_username_password, |
326 | 331 | _remove_account, |
327 | 332 | ] + ([ |
328 | 333 | _acquire_token_for_client, |
|
0 commit comments