点击login with Balosar project (wasm + openiddict),如何开启CORS?
Click on login with Balosar project (wasm + openiddict), how to enable CORS?
我运行宁Balosar project如下:
我编辑Balosar.Client Program.cs:
options.ProviderOptions.Authority = "https://localhost:44360/";
我运行服务器
dotnet run urls=https://localhost:44360
我运行客户
dotnet run
根据客户端项目的 launchSetings.json,我将浏览器连接到 https://localhost:44310。
当我在浏览器中单击 Log In
时,我在网络控制台中看到以下内容:
以及浏览器中的以下消息:
There was an error trying to log you in: 'Network Error'
服务器收到 https://localhost:44360/.well-known/openid-configuration
请求并发送响应(我可以在控制台中读取),但响应从未到达客户端。
我想我必须配置 CORS,但我不知道在哪里。
Balosar 项目是使用托管模板设置的。
当您启动服务器项目(而不是客户端)并将浏览器指向服务器时,它应该可以工作 URL。当客户端由服务器提供服务时,您不需要 CORS。
当您想在其他地方启动客户端表单时,您需要 add CORS settings in the Server project。
我运行宁Balosar project如下:
我编辑Balosar.Client Program.cs:
options.ProviderOptions.Authority = "https://localhost:44360/";
我运行服务器
dotnet run urls=https://localhost:44360
我运行客户
dotnet run
根据客户端项目的 launchSetings.json,我将浏览器连接到 https://localhost:44310。
当我在浏览器中单击 Log In
时,我在网络控制台中看到以下内容:
以及浏览器中的以下消息:
There was an error trying to log you in: 'Network Error'
服务器收到 https://localhost:44360/.well-known/openid-configuration
请求并发送响应(我可以在控制台中读取),但响应从未到达客户端。
我想我必须配置 CORS,但我不知道在哪里。
Balosar 项目是使用托管模板设置的。
当您启动服务器项目(而不是客户端)并将浏览器指向服务器时,它应该可以工作 URL。当客户端由服务器提供服务时,您不需要 CORS。
当您想在其他地方启动客户端表单时,您需要 add CORS settings in the Server project。