0

We are currently trying to catch an error, when a user with a company Azure AD Account tries to access the application, but does not have access to the tenant where the application resides (Multi-tenant authorization has been setup on the app).

The user enters their credentials, and gets the below error when trying to login (which is the desired and expected behavior and which we are unable to capture):

User Login Error

The user has to cancel the authentication flow (as an automatic redirect back to the app does not occur on this error), which in turn does not allow us to capture that specific error (or any errors during the login process).

Is there a method we can utilize from either the MSAL Service or the Broadcast Service that will allow us to capture errors from the Azure Login Page (pictured above).

We've cloned the following repository from Microsoft to test error capturing during the login process (using clean, working code from a trusted source, which we confirmed works as intended):

https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/v2-docs/redirects.md

We've found that the logging used in the MSAL Configuration (however verbose), does not actually capture the errors from the redirect flow. The closest we've come to capturing the error, was adding the below code to catch the BrowserAuthError (user_cancelled the flow) and logging it to the console.

1

0