Azure AD应用程序可以具有水疗或Web应用程序,或者我们可以同时拥有?

发布于 2025-02-05 09:57:21 字数 281 浏览 3 评论 0原文

Azure AD应用程序可以具有水疗或Web应用程序,或者我们可以同时拥有? 我在Azure AD中创建应用程序,并且具有 Web和API,都有本地主机URL。

  1. 因此,Web应用程序重定向URI:localhost:/5020添加了平台Web

  2. Web API重定向URI:localhost:/5030添加了此功能 Web API平台

,但它给我带来了React msal.js的错误 “仅适用于'单页申请'客户端类型的跨原始令牌赎回”

Azure AD Application can have SPA or Web App or we can have both?
i have create app in azure ad and that have both
web and api and both have local host url.

  1. so web application redirect uri :localhost:/5020 added platform web

  2. web api redirect uri :localhost:/5030 added this will
    web api platform

but it giving me error with react msal.js
"Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type"

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

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

发布评论

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

评论(1

亣腦蒛氧 2025-02-12 09:57:21
  1. 水疗应用程序实际上是用JavaScript编写的,该JavaScript控制UI
    登录用户并获取令牌甚至致电Web的元素
    使用JavaScript直接从浏览器中的API。这样的
    在Azure注册时,必须在Spa 下注册申请
    广告应用程序注册。
  2. Web应用程序也从HTML和JavaScript呈现页面,但请致电Web
    API是在后端完成的。因此,它们必须在Web App平台下注册。

因此,请更改应用程序注册 - > Authentication->平台类型为SPA ,如果它仅使用Java脚本(例如:Angular,React等)而不是Web。
或否则将其更改为Web。

也要纠正后,请确保您不使用 client凭据流用于您的Spa App ie ie; (使用客户端秘密)。use 授权代码流在这种情况下。

  1. SPA app is actually written in JavaScript which control the UI
    elements to sign in users and acquire tokens or even call the web
    apis directly from the browser using the javascript. Such
    applications must be registered under SPA while registering in azure
    ad app registration.
  2. Where as web apps also do render pages from HTML and javascript ,but calling web
    API's is done on backend. So they must be registered under web app platform.

So please change the App registration -> Authentication->platform type to SPA if it only uses Java script (ex: angular, react etc) instead of Web.
Or change it to web otherwise.
enter image description here

Also after correcting that, please make sure you are not using client credential flow for your SPA App i.e.; (using client secret).Use authorization code flow instead in that case.

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