In my Angular application, I am experiencing an issue during the SSO login process with Azure AD. After receiving a successful response from the backend containing the Azure AD authorization URL, I redirect the user using window.location.href = azureAdRedirectUrl;.
Upon successful authentication, Azure AD redirects the user back to my application with a 302 status code, along with the updated URL containing the query parameter code (e.g., https://myapp.com/login?code=someValue). However, instead of proceeding with the login flow, my application displays a blank page and remains stuck, despite the browser reflecting the correct redirected URL in the address bar.
This issue was not present earlier and was working fine a few days ago. Additionally, I have verified that no recent frontend changes were pushed by anyone in my organization that could have affected this behavior.
Observations:
This suggests that opening DevTools influences the execution flow, potentially pointing to a timing issue, race condition, or an execution delay that affects the app’s bootstrapping.
Question:
What could be causing this intermittent blank page after the Azure AD redirect? Could this be due to a race condition or timing issue in Angular’s bootstrapping or query parameter processing? Sometimes, Why would opening Developer Tools cause the issue to resolve itself?
Any insights or debugging suggestions would be greatly appreciated.
What I’ve Tried:
Finally, I’ve identified the root cause of the issue — Chromium’s latest update in Chrome & Edg, v133, is triggering the blank page problem. When testing on a peer’s machine with Chrome v132, everything functions correctly. I checked cross-browser compatibility and it works fine in freshly installed Firefox.
I’m currently reviewing Chromium v133’s breaking changes to pinpoint the exact cause. The blank page issue doesn’t just occur during SSO login; it sometimes happens on a simple page reload as well. Has anyone come across similar issues? Any insights on potential workarounds or key changes in Chromium v133 that might be causing this?
I was able to resolve the same issue in my application.
I am using Module Federation along with Webpack. I had created a library called @myApp/lib-user. In the public-api.ts file of this library, I was exporting references from service files related to the MSAL function, like this:
public-api.ts :
export * from "./lib/token-read.service";
In my components and other required places, I was importing the service like this:
import { TokenReadService } from "@myApp/lib-user";
To fix the issue, I changed the import to reference the direct file path instead:
import { TokenReadService } from "projects/lib-user/src/public-api";
With this change, I was able to resolve the issue, and now the page refreshes without getting stuck.
I am not sure if you have the same structure, but if you do, give this a try. Also, I should mention that in Chrome version 132, everything was working fine. I only started facing this issue in version 133
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With