Support the suberror in the MsalServiceException object
See original GitHub issueRecently the Azure AD add a new member in the error object called suberror. It gives a detail reason of the “errorcode”. For example, when errorCode is “invalid_grant”, the error could be:
suberror = basic_interaction
{"error":"invalid_grant","error_description":"AADSTS50079: Due to a configuration change made by your administrator, or because you moved to a new location, you must enroll in multi-factor authentication to access '00000003-0000-0000-c000-000000000000'.\r\nTrace ID: xxxxxxx-xxxx-4b59-8e9d-ae82f87f0100\r\nCorrelation ID: xxxxxxx-xxxx-47ce-ab12-0c3168711141\r\nTimestamp: 2018-05-02 22:12:01Z","error_codes":[50079],"timestamp":"2018-05-02 22:12:01Z","trace_id":"xxxxxxx-xxxx-4b59-8e9d-ae82f87f0100","correlation_id":"xxxxxxx-xxxx-47ce-ab12-0c3168711141","claims":"{\"access_token\":{\"capolids\":{\"essential\":true,\"values\":[\"xxxxxxx-xxxx-41e6-9613-0ec6218e5c2d\",\"xxxxxxx-xxxx-4cfb-befc-528739166b20\"]}}}","suberror":"basic_action"}
suberror = consent_required
{"error":"invalid_grant","error_description":"AADSTS65001: The user or administrator has not consented to use the application with ID 'xxxxxxx-xxxx-4da6-8360-f45f5a9578f1' named 'TEST ADDIN'. Send an interactive authorization request for this user and resource.\r\nTrace ID: xxxxxxx-xxxx-437e-9cb4-c5464c810100\r\nCorrelation ID: xxxxxxx-xxxx-4788-b265-6a97c00a9e65\r\nTimestamp: 2018-05-02 22:14:20Z","error_codes":[65001],"timestamp":"2018-05-02 22:14:20Z","trace_id":"xxxxxxx-xxxx-437e-9cb4-c5464c810100","correlation_id":"xxxxxxx-xxxx-4788-b265-6a97c00a9e65","claims":"{\"access_token\":{\"capolids\":{\"essential\":true,\"values\":[\"xxxxxxx-xxxx-41e6-9613-0ec6218e5c2d\",\"xxxxxxx-xxxx8-4cfb-befc-528739166b20\"]}}}","suberror":"consent_required"}
However, suberror is not a member of the MsalServiceException object. So the developer cannot get this value and they won’t know the detailed error reason. . This suberror code is vital in some scenario.
Therefore we hope that the MsalServiceException object should have a new member called SubError to hold this important information.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
Thanks for fixing this issue. 😃
Fixed in MSAL 3.0.0-preview release