question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support the suberror in the MsalServiceException object

See original GitHub issue

Recently 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:closed
  • Created 5 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pkkjcommented, Feb 27, 2019

Thanks for fixing this issue. 😃

0reactions
jennyf19commented, Feb 27, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] AcquireTokenByUsernamePassword over SAML ...
When Authenticate is called from the VB6 app the Object error is seen and when called from the VB.net test app it works....
Read more >
MsalError Class (Microsoft.Identity.Client)
The client is unauthorized to access resource. This commonly happens when Mobile App Management (MAM) policies are enabled. MSAL will throw an exception...
Read more >
MsalServiceException Class
This exception class represents errors when communicating to the service, can be from the authorize or token endpoints.
Read more >
AADSTS501461 when trying to access a Web API from ...
I'm calling from a console app using ConfidentialClientApplication. Below is the error message. Microsoft.Identity.Client.MsalServiceException: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found