windows-server-2012 - 系统参数异常 : An item with the same key has already been added

标签 windows-server-2012 adfs

我在 Windows Server 2012 上配置了 ADFS,当我尝试访问 https://abc-idfs.cloudapp.net/adfs/ls/IdpInitiatedSignOn.aspx 时我得到一个错误:

Exception details: 
System.ArgumentException: An item with the same key has already been added.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Microsoft.IdentityServer.Web.HomeRealmModule.FindApplicableRealms(ProtocolContext context, Boolean needsIDPInstance)
   at Microsoft.IdentityServer.Web.HomeRealmModule.DiscoverHomeRealm(PassiveProtocolHandler pHandler, ProtocolContext context)
   at Microsoft.IdentityServer.Web.PassiveProtocolListener.GetAuthenticationMethods(PassiveProtocolHandler protocolHandler, ProtocolContext protocolContext)
   at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)

我不明白我哪里出错了

最佳答案

从头开始设置新的 ADFS 服务器时,这种情况在我身上发生过很多次。在我的例子中,我有设置服务器的 powershell 代码,但在脚本运行后它总是给我这个错误,所以我知道它是配置中的东西而不是 ADFS 本​​身。

所以最后问题出在我的案例上:Claims provider identifier needs to have https://instead of http://

要检查此设置的值,请​​打开 AD FS 管理 UI,展开信任关系,选择声明提供者信任,选择您的声明提供者并右键单击并选择属性,然后转到标识符选项卡并查看声明提供者标识符- 如果此值没有 https://并且您正在使用证书来处理服务通信,您将在日志中获得带有此确切消息的事件 ID 364。

364 的发生有多种原因,不仅仅是我在这里提到的一个,但这个问题非常简单,很容易被忽视。希望这对某人有帮助。

关于windows-server-2012 - 系统参数异常 : An item with the same key has already been added,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31878061/

相关文章:

c# - Active Directory 联合身份验证服务是否支持 OpenID Connect 声明提供程序

windows - 如何在批处理脚本中刷新 PATH 环境变量

c++ - _getch() 在 Windows Server 2012 上不起作用

powershell - 尝试远程连接到本地主机上的Exchange服务器时出现"Access Is Denied"错误

ios - 使用带有 ADFS 的系统登录 iOS 应用程序

asp.net - WS-Federation 登录 Asp.NET 5 MVC 6 ADFS

iis - Microsoft Azure 中的 Windows Server 2012/IIS8 上的客户端证书身份验证收到 HTTP 403.16

asp.net - 什么会导致默认路由失败?

spring - 将 Spring 授权服务器连接到外部 IDP 并触发身份验证

asp.net - 将 ADFS 与 ASP.NET Web 应用程序集成的最简单方法