导航到深层途径,以防万一Angular应用

发布于 2025-01-30 00:48:24 字数 1120 浏览 5 评论 0 原文

我有一个Angular应用程序: https://abc.xyz.com 托管在Azure App Service中。这具有使用单独的Azure应用服务和不同URL托管的后端API: https://xxx.yyy.com 。两个端点均在Azuread注册。只有身份验证的用户才能登录应用程序,并且对API的所有请求都必须通过前端服务层的标头传递令牌。

假设应用程序中有一条路线: https://abc.xyz.com/# !/test/100

现在,当我打开一个新的浏览器实例并尝试上述URL时,它要求我遵循Azuread身份验证所需的所有步骤,然后将我导航到着陆页: https://xyz.abc.com 代替 https://abc.xyz.com/#!/test/100

在这种情况下,我希望用户可以导航到请求的路线: https://abc.xyz.com/#!/test/100 而不是将他带到着陆点页面: https://abc.xyz.com/ 发布身份验证过程。

谁能在这种情况下提供指导?

I have a angular application with URL: https://abc.xyz.com hosted within Azure App Service. This has a backend API hosted using a separate Azure App Service and different URL: https://xxx.yyy.com. Both the endpoints are registered with AzureAD. Only authenticated users can login into the application and all the requests to the API has to pass the token via the header from the frontend services layer.

Lets say there is a route within the application: https://abc.xyz.com/#!/test/100

Now when I open a new browser instance and try the above URL, it asks me to follow all the steps required for AzureAD authentication and navigates me to the landing page:https://xyz.abc.com instead of https://abc.xyz.com/#!/test/100

In this case I am expecting user to be navigated to the requested route : https://abc.xyz.com/#!/test/100 instead of taking him to the landing page: https://abc.xyz.com/ post authentication process.

Can anyone provide their guidance regarding this scenario?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

帅哥哥的热头脑 2025-02-06 00:48:24

请检查以下几点是否有一些想法。

  1. afaik,默认行为是将用户重定向到原始
    页IE;应用程序注册过程中提到的重定向URL,
    当微软身份基本上检查状态是否受到保护
    在将位置更改为其他路径之前,通过Azure AD。
  2. 请通过尝试尝试
    页面重定向到所需的路径预览。
  3. 您也可以尝试在Azure中添加该路径的另一个重定向URL
    广告门户。

Please check if below points give some idea.

  1. AFAIK, the default behavior is to redirect the user to the original
    page i.e; the redirect url mentioned in the app registration process,
    as microsoft identity basically checks the state whether is protected
    by Azure AD before the location is changed to other path than that.
  2. Please check this blog on Redirect to a custom login page when
    securing your Angular app with MSAL - Waldek Mastykarz
    to try the
    page redirect to the path previews required.
  3. You may also try adding another redirect url of that path in azure
    ad portal.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文