具有Angular Frontend和.NET后端的Azure SSO的SAML配置
我正在尝试为Azure SSO配置SAML,并遵循此示例:
但是,我会收到以下错误:
“访问xmlhttprequest,请访问“ https://login.microsoftonline.com/../ (从“ https:// localhost:44 ..”重定向 “ http:// localhost:4200'已被CORS策略阻止:否 请求的“访问控制”标头 资源。”
我被告知我不需要在Angular中做任何事情,并且在.NET中进行配置就足够了。我已经看到了其他人也在使用JWT身份验证的答案。我无法理解如果不使用JWT可以实现这一点?
PS我使用的是REST API,而不是MVC。
I am trying to configure SAML in .NET for Azure SSO and I followed this example:
However, I get the following error:
"Access to XMLHttpRequest at "https://login.microsoftonline.com/../
(redirected from "https://localhost:44.." from origin
"http://localhost:4200' has been blocked by CORS policy: No
'Access-Control-Allow-Origin' header is present on the requested
resource."
I have been told that I need not do anything in Angular and configuring in .NET will suffice. I have seen answers where others are using JWT authentication as well. I am unable to understand if this can be achieved without using JWT?
P.S. I am using REST API and not MVC.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我首次连接前端和后端时,我遇到了类似的错误(在请求的资源上没有“访问控制”标头。在我的情况下,解决方案是在< system.webserver>的后端web.config中添加CORS配置。允许从给定域中访问。这也允许从您的前端角传递到后端应用程序。
I had experienced a similar error (No 'Access-Control-Allow-Origin' header is present on the requested resource.) when I was first connecting my front end and back end. The solution in my case was to add cors configurations to the ?Backend web.config under <system.webServer> to allow access from the given domain. This also allows for credentials to be passed to the backend application from your front end Angular.