【发布时间】:2019-05-02 19:03:37
【问题描述】:
我有一个成功使用本地活动目录联合服务的现有 mvc 5 应用程序
相关的网络配置设置
<appSettings>
<add key="ida:Issuer" value="https://www.fedsvc3copa.beta.pa.gov/adfs/ls/"/>
</appSettings>
<authority name="http://www.fedsvc3copa.beta.pa.gov/adfs/services/trust">
<keys>
<add thumbprint="xxxxxxxxxxxxxxx"/>
</keys>
<validIssuers>
<add name="http://www.fedsvc3copa.beta.pa.gov/adfs/services/trust"/>
</validIssuers>
</authority>
<federationConfiguration>
<cookieHandler requireSsl="true"/>
<wsFederation passiveRedirectEnabled="true" issuer="https://www.fedsvc3copa.beta.pa.gov/adfs/ls/" realm="https://localhost:44363/" requireHttps="true"/>
</federationConfiguration>
尝试为 .net 核心 mvc 应用程序做同样的事情。但我有点困惑在startup.cs中放什么
所以我有
.AddWsFederation(options =>
{
// MetadataAddress represents the Active Directory instance used to authenticate users.
options.MetadataAddress = "https://www.fedsvc3copa.beta.pa.gov/federationmetadata/2007-06/FederationMetadata.xml";
// Wtrealm is the app's identifier in the Active Directory instance.
// For ADFS, use the relying party's identifier, its WS-Federation Passive protocol URL:
options.Wtrealm = "https://localhost:44363/";
// For AAD, use the App ID URI from the app registration's Properties blade:
options.Wtrealm = "???????";
});
我不知道在 AAD 领域中应该放什么,因为我没有使用 azure。我也不需要指纹和发行人吗? http://www.fedsvc3copa.beta.pa.gov/adfs/services/trust
【问题讨论】:
-
您不需要在最后一个属性中提供任何内容,即您填写的
???。文档显示了两种不同的方式,请注意属性名称与上面的相同。第一个.Wtrealm示例用于 ADFS,第二个示例用于 AAD。只需删除第二个。我不熟悉这个特定的 Active Directory 设置,只是从文档中注意到。 -
是的,我试过了,它会将我带到 orgs 登录页面,但我收到错误错误发生错误发生。有关详细信息,请联系您的管理员。错误详细信息 活动 ID:c2667d30-335f-4da5-6b0a-0080010000e4 错误时间:2019 年 5 月 6 日星期一 17:32:05 GMT Cookie:已启用 用户代理字符串:Mozilla/5.0(Windows NT 10.0;Win64;x64)AppleWebKit/537.36 (KHTML,如 Gecko)Chrome/74.0.3729.131 Safari/537.36
标签: c# asp.net-mvc authentication .net-core adfs