Capture Entra Id AADSTS50105 error in SPA using Angular MSAL

Anonymous
2026-01-22T13:27:57.4766667+00:00

I have an Angular SPA application which uses Angular MSAL, enabling users to log into the application. The security permissions (Read directory data) to access the Entra Id User Log Data have been denied by business for security reasons, therefore I am unable to fetch the user login data from Entra Id API:

https

Hence i have to manually save the user data to a database when a user logs into the application, including failed attempts. Successful logins are being saved. However failed logins (i.e. AADSTS50105) are not being caught and saved.

How or where do I catch the failed logins like the following example:
User's image

Any advice in approach would be appreciated.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} vote

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.