-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Identity] Azure Identity should expose the original MSAL error #16906
Comments
What do you mean by "handle MSAL error directly"? It's |
Only ADAL and MSAL returns Exposing the original error makes Azure CLI's error handler much easier, as the error handler can be used for
at the same time. + @rayluo |
We can't really tell which fields will be needed in the future. If MSAL raised an raise RuntimeError from exc So I think the same should apply to the error |
From MSAL's perspective, an error response is equally likely as a successful response, so the return value is a By the way, that Exception Chaining was introduced since Python 3.3. This might not be a problem for Azure CLI as an application, but historically Azure Identity and MSAL work with Python 2.7 too.
Maybe we can start with |
@chlowell would it be possible to patch this in an offcycle release for the CAE e2e private testing? |
I forgot
So for Azure CLI's displaying purpose, we are good for now.
As a side note: It would still be better to expose
As a conclusion:
|
As discussed offline, I've opened a PR to address this by attaching Azure AD's HTTP response to authentication exceptions whenever possible. That will provide all the information returned by MSAL after an auth failure while remaining consistent with exceptions raised by credentials that do not use MSAL. |
[Azure SignalR Service]changes introduced by new version of Swashbuckle (Azure#16906) * [Azure SignalR Service]changes introduced by new version of Swashbuckle * add back default value * revert parameter orders * Update settings.json
[Azure SignalR Service]changes introduced by new version of Swashbuckle (Azure#16906) * [Azure SignalR Service]changes introduced by new version of Swashbuckle * add back default value * revert parameter orders * Update settings.json
[Azure SignalR Service]changes introduced by new version of Swashbuckle (Azure#16906) * [Azure SignalR Service]changes introduced by new version of Swashbuckle * add back default value * revert parameter orders * Update settings.json
[Azure SignalR Service]changes introduced by new version of Swashbuckle (Azure#16906) * [Azure SignalR Service]changes introduced by new version of Swashbuckle * add back default value * revert parameter orders * Update settings.json
[Azure SignalR Service]changes introduced by new version of Swashbuckle (Azure#16906) * [Azure SignalR Service]changes introduced by new version of Swashbuckle * add back default value * revert parameter orders * Update settings.json
[Azure SignalR Service]changes introduced by new version of Swashbuckle (Azure#16906) * [Azure SignalR Service]changes introduced by new version of Swashbuckle * add back default value * revert parameter orders * Update settings.json
Is your feature request related to a problem? Please describe.
When
AuthenticationRequiredError
is raised, the original MSALresult
(error dict) is discarded:azure-sdk-for-python/sdk/identity/azure-identity/azure/identity/_internal/interactive.py
Lines 198 to 202 in ef46a5c
This makes
aad_exception_handler
(Azure/azure-cli#17072) impossible to handle MSAL error directly.Describe the solution you'd like
AuthenticationRequiredError
should have an attribute referring to the original MSALresult
.The text was updated successfully, but these errors were encountered: