blazor - 已部署的 Blazor 客户端尝试访问 OIDC 的 Localhost .well-known/openid-configuration
问题描述
我已经在 Ubuntu 机器上部署了一个开箱即用的app.UseHttpsRedirection();
.NET 5.0 Blazor WebAssembly 应用程序(注释掉的除外)和个人帐户dotnet publish --configuration Release
。
appsettings.json 是这样配置的
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=machine's ip;Initial Catalog=db;User Id=username;Password=password"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"IdentityServer": {
"Clients": {
"WebApplication.Client": {
"Profile": "IdentityServerSPA"
}
},
"Key": {
"Type": "File",
"FilePath": "../certificate.pfx",
"Password": "password",
"Name": "/CN=name"
}
},
"Kestrel": {
"Certificates": {
"Default": {
"Path": "../certificate.pfx",
"Password": "password"
}
}
},
"AllowedHosts": "*"
}
apache2.conf 是这样配置的
...
<Location /test>
ProxyPass http://localhost:5000
ProxyPassReverse http://localhost:5000
ProxyHTMLURLMap http://localhost:5000
ProxyHTMLURLMap / /test/
</Location>
...
当我按预期通过 http://localhost:5000 在本地访问它时,它工作正常。当我尝试从网络通过 http:// machine's_ip /test 访问它时,页面按预期加载并正常运行,除了通过 GET http://localhost:5000/.well-known/ 进行的身份验证openid 配置网络::ERR_CONNECTION_REFUSED。
如何让 Blazor 客户端从机器的 IP 而不是不存在的 localhost 获取 OIDC?
解决方案
推荐阅读
- keras - Keras 中的 ResNet50v2
- html - 如何在 Angular 8 中显示值显示错误类型错误:无法读取未定义的属性“项目名称”
- unity3d - 为什么 BoxColliders 碰撞不起作用?
- python - 被称为请求的 python 库仅适用于 web url 还是本地 html 文件?
- c# - 如何检测进程是否移动了鼠标光标而不是用户?
- sql - 通过 Oracle 外部表读取 CSV 文件时跳过标题
- python-3.x - 在python中编写一个特定的函数
- python - How do I exclude the last line of user input?
- c - CMake:另一个具有相同名称的目标存在于一个链接库中
- excel - 无法使用 vba 解析网页中某个项目的特定值