在应用程序之间移动时显示进度指示器

时间:2023-01-09 04:02:43

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

我使用IdentityServer4进行身份验证/授权,这是一个独立的应用程序

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.

在客户端应用程序(ASP)中。如果用户单击login,它们将被重定向到IDS4,在成功登录之后,它们将被重定向回客户端应用程序。

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?

目前,在重定向过程中,页面是空的,没有发生任何事情。有谁知道在IDS4和客户端之间进行重定向时是否有方法显示进度指示器/旋转器?

1 个解决方案

#1


1  

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.

我以前也做过类似的事情,最好的解决方案似乎是优化客户端应用程序,以便在获取第一个资源后立即呈现加载屏幕,然后动态地加载后面的应用程序的其余部分。这在ASP中有点难。NET因为在服务器端渲染完成之前不能交付初始页面,但是这是可能的。

#1


1  

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.

我以前也做过类似的事情,最好的解决方案似乎是优化客户端应用程序,以便在获取第一个资源后立即呈现加载屏幕,然后动态地加载后面的应用程序的其余部分。这在ASP中有点难。NET因为在服务器端渲染完成之前不能交付初始页面,但是这是可能的。