Skip to content

[Bug] Original AADSTS error is hidden by WAM #698

Open
@jiasli

Description

@jiasli

Describe the bug
Original AADSTS error is hidden by WAM.

To Reproduce
Steps to reproduce the behavior:

With browser-based flow, AADSTS error is shown which contains detailed message explaining what happened:

> az config set core.enable_broker_on_windows=false

> az login --scope https://graph.microsoft.com/User.ReadWrite
A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
AADSTS65002: Consent between first party application '04b07795-8ddb-461a-bbee-02f9e1bf7b46' and first party resource '00000003-0000-0000-c000-000000000000' must be configured via preauthorization - applications owned and operated by Microsoft must get approval from the API owner before requesting tokens for that API. Trace ID: 63016864-b8bc-471b-ab7e-0d7905808d00 Correlation ID: 6dcd284f-5691-4e77-a342-29f87f82d0d6 Timestamp: 2024-05-09 07:56:22Z

However, when WAM is used, the original AADSTS error is hidden, leaving a less informative error message:

> az config set core.enable_broker_on_windows=true

> az login --scope https://graph.microsoft.com/User.ReadWrite
Please select the account you want to log in with.
(pii). Status: Response_Status.Status_IncorrectConfiguration, Error code: 3399614466, Tag: 557973643

Expected behavior
WAM should expose the original AADSTS error.

What you see instead
A rephrased, less informative error message.

The MSAL Python version you are using
1.28.0

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions