Azure B2C-链接到HTML模板中的源域

发布于 2025-02-12 08:34:31 字数 486 浏览 0 评论 0原文

当用户降落在我们的主页上时,它们会从我们的域上开始。如果它们未登录,则将其重定向到Azure B2C登录页面(在不同的域上)。我已经通过实现自己的 html模板

我想将模板中的链接添加到原始域上的一个关于页面。我可以将其用力编码为生产URL。但是,根据我是在本地开发机,测试,分期还是生产的情况下,我有不同的源域。

有没有办法参考模板中的源域?

我认为一种方法是启用JavaScript并从redirect_uri中提取基本URL。但是,HTML模板内置了任何内置的东西,可以使我声明地这样做(在提供页面之前)?

When a user lands on our home page they start on our domain. If they're not logged in, then they're redirected to the Azure B2C login page (which is on a different domain). I've updated the UI by implementing our own Html Template.

I'd like to add a link in the template to an about page on the original domain. I could hard code this to the production url. However, I have different source domains depending on whether I'm working on my local dev machine, testing, staging or production.

Is there a way to refer to the source domain in the template?

I assume one way would be to enable javascript and extract the base url from the redirect_uri. But is there anything built-in to Html Templates that will let me do this declaratively (before the page is served)?

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

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

发布评论

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

评论(1

纸短情长 2025-02-19 08:34:31

仅在普通HTML的前端无法在前端创建某种解析器。您需要使用JavaScript在前端构建关于大约页面的URL,或使用硬编码链接使用每个环境的单独的HTML模板。

There's no way to create some sort of resolver on the front end in just plain HTML. You'll need to use JavaScript to build the URL for the about page on the front end or use separate HTML templates per environment with hard coded links.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文