从NGINX代理后面通过.NET Core连接到Azure B2C

编程入门 行业动态 更新时间:2024-10-12 05:49:31
本文介绍了从NGINX代理后面通过.NET Core连接到Azure B2C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

几乎可以正常工作.差不多.

我的设置是我已经设置了Azure B2C租户,并且进行了一些修改示例代码.所有这些都可以在本地使用本地主机uri正常工作.

我的远程设置是Ubuntu 16.01服务器,其中Nginx 1.10.0 Web服务器充当.NET Core 1.0.4的反向代理,并且全部具有LetsEncrypt SSL证书.

代理可以很好地为.NET项目提供服务,但是当我点击登录时,它将带我使用错误的redirect_url转到B2C登录.

我希望该值反映设置文件"https.sub.host.suffix/signin-oidc"中的内容,而不是"http.sub.host.suffix,sub.host.suffix" /signin-oidc"

任何想法或建议表示赞赏!

解决方案

如果NGINX正在卸载SSL/TLS,然后调用.NET Core应用,请检查是否有可能通过打开的HTTP(端口80)来完成此操作. >

您要么需要始终确保HTTPS,要么发信号通知HTTPS方案被触发(如果调用了HTTP端点).

.NET Core应用程序通过HTTP端点获取请求时,由它创建的每个URI都将保持相同的方案.因此,您需要在链接建立时强制使用.

希望有帮助!

Almost have this working. Almost.

My set up is that I have an Azure B2C Tenant set up, and some modified example code that I've changed to reflect the Tenant information. This all works fine locally, with a localhost uri.

My remote set up is a Ubuntu 16.01 server, with a Nginx 1.10.0 webserver acting as a reverse proxy to a .NET Core 1.0.4 and all with a LetsEncrypt SSL cert.

The proxy serves .NET projects fine, however when I hit the sign in it takes me over to the B2C login with an incorrect redirect_url.

I'd expect the value to reflect what is in the settings file, "https.sub.host.suffix/signin-oidc" instead I'm getting "http.sub.host.suffix,sub.host.suffix/signin-oidc"

Any ideas or suggestions appreciated!

解决方案

If NGINX is offloading SSL/TLS and then calling the .NET Core app, check as most probably is doing it through open HTTP (port 80).

You either need to ensure HTTPS all-the-way, or signal an HTTPS scheme to get triggered if HTTP endpoint was called.

As the .NET Core App gets a request through an HTTP endpoint, every URI created by it will keep that same scheme. So, you'll need to force at link building time.

Hope it helps!

更多推荐

从NGINX代理后面通过.NET Core连接到Azure B2C

本文发布于:2023-11-14 17:50:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1588139.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   NET   NGINX   Core   B2C

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!