Search code examples
javascripthtmlasp.netasp.net-mvcasp.net-identity

show progress indicator when moving between applications


I'm using IdentityServer4 for authentication/Authorization, which is a standalone application

In the client application (ASP.NET MVC), if a user clicks login, they are redirected to IDS4, After a successful login, they are redirected back to the client application.

Currently, during the redirects, the page is blank, like nothing is happening. Does anyone know if there is a way to show a progress indicator/spinner when redirecting between IDS4 and the client?


Solution

  • I believe this is not possible, largely for security reasons. When you're navigating from one domain to the other, the browser needs to do a nice clean hand-off to prevent data contamination (see Same Origin Policy for an outline for why this matters).

    I've done something similar in the past and the best solution seems to be optimising the client application so that it immediately renders a loading screen as soon as the first resources are fetched, and then dynamically load the rest of the app behind it. This is a bit harder in ASP.NET because the initial page can't be delivered until the server-side render is done, but it is possible.