【发布时间】:2020-05-31 13:37:48
【问题描述】:
我有一个 .Net 核心应用程序。我尝试使用 AzureAd 身份验证。它在 LocalHost 上运行良好,但是当我在公司服务器上部署应用程序时,我遇到了代理凭据问题。 我使用了以下代码但无法正常工作:
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
.AddAzureAD(options => Configuration.Bind("AzureAd", options))
.AddOpenIdConnect(options => options.BackchannelHttpHandler = new HttpClientHandler
{
UseProxy = true,
Proxy = new WebProxy
{
Credentials = new NetworkCredential
{
UserName = "my_UserName",
Password = "my_Password "
},
Address = new Uri("my_Domain:my_Port")
}
});
应用设置:
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "My_Domain",
"TenantId": "*************",
"ClientId": "******",
"CallbackPath": "/signin-oidc"
}
【问题讨论】:
-
能否分享一下您部署应用时的错误详情
标签: c# .net-core proxy azure-ad-b2c