AzureAD / microsoft-authentication-library-for-python

Microsoft Authentication Library (MSAL) for Python makes it easy to authenticate to Microsoft Entra ID. General docs are available here https://learn.microsoft.com/entra/msal/python/ Stable APIs are documented here https://msal-python.readthedocs.io. Questions can be asked on www.stackoverflow.com with tag "msal" + "python".
https://stackoverflow.com/questions/tagged/azure-ad-msal+python
Other
757 stars 192 forks source link

allow_broker=True for ConfidentialClientApplication returns error #544

Closed victormatyiku closed 1 year ago

victormatyiku commented 1 year ago

Describe the bug Trying to pass allow_broker=True for as an argument for ConfidentialClientApplication returns an error that it is not supported. However, the documentation says that it is supported.

Expected behavior For the package to try to create a broker.

What you see instead Traceback (most recent call last): File "c:\Users\matyvic\Documents\CSPC\colectica-rest-api-demo\python\corestica\corestica.py", line 561, in staging_test = ColecticaRepository( File "c:\Users\matyvic\Documents\CSPC\colectica-rest-api-demo\python\corestica\corestica.py", line 131, in init self.authenticate_via_sign_in(username, password) File "c:\Users\matyvic\Documents\CSPC\colectica-rest-api-demo\python\corestica\corestica.py", line 171, in authenticate_via_sign_in app = msal.ConfidentialClientApplication( File "C:\Users\matyvic\AppData\Roaming\Python\Python39\site-packages\msal\application.py", line 555, in init raise ValueError("allow_broker=True is only supported in PublicClientApplication") ValueError: allow_broker=True is only supported in PublicClientApplication

The MSAL Python version you are using 1.21.0

rayluo commented 1 year ago

That error ValueError: allow_broker=True is only supported in PublicClientApplication is intentional and self-explained. It is our docs that currently reuse the same inline content from the base class. Please keep this issue open, and we will see what we can do to improve the doc.

Meanwhile, please do not use allow_broker=True in your ConfidentialClientApplication.