【问题标题】:ID4175: The issuer of the security token was not recognized by the IssuerNameRegistryID4175:安全令牌的颁发者未被 IssuerNameRegistry 识别
【发布时间】:2013-12-18 19:09:32
【问题描述】:

我正在尝试在开发环境中与我的 MVC 应用程序一起实现一个简单的 STS 网站。我能够在我的本地机器上正常工作。我会导航到我的 MVC 应用程序,踢出到 STS Web 应用程序,我登录,然后被重定向回我的 MVC 应用程序。顺便说一句,这不是使用 AFDS。

当我将它迁移到我的开发环境时,我看到了类似的活动,但我在登录时收到以下错误。我已经检查了大约 20 次,我在 MVC 应用程序中的指纹与证书完全相同。

(登录工作正常,因为在身份验证成功之前我不会被重定向。)

有什么猜测吗?

我收到的错误消息:

ID4175:安全令牌的颁发者未被 IssuerNameRegistry 识别。要接受来自此颁发者的安全令牌,请将 IssuerNameRegistry 配置为返回此颁发者的有效名称

来自 STS 网站的 web.config:

<appSettings>
<add key="IssuerName" value="STSTestCert"/>
<add key="SigningCertificateName" value="CN=STSTestCert"/>
<add key="EncryptingCertificateName" value=""/>
  </appSettings>

来自 MVC 应用程序的 web.config:

<microsoft.identityModel>
<service>
  <audienceUris>
    <add value="http://localhost/" />
  </audienceUris>
  <federatedAuthentication>
    <wsFederation passiveRedirectEnabled="true" issuer="http://localhost:57543/mySTS/" realm="http://localhost/" requireHttps="false" />
    <cookieHandler requireSsl="false" />
  </federatedAuthentication>
  <applicationService>
    <claimTypeRequired>
      <!--Following are the claims offered by STS 'http://localhost:57543/mySTS/'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
      <claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
      <claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
    </claimTypeRequired>
  </applicationService>
  <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <trustedIssuers>
      <add thumbprint="‎11111" name="http://localhost:57543/mySTS/" />
        </trustedIssuers>
      </issuerNameRegistry>
    </service>
  </microsoft.identityModel>

【问题讨论】:

  • 你解决过这个问题吗?我自己现在也遇到同样的错误。
  • 和马特一样的问题。你解决过这个问题吗?

标签: asp.net-mvc web-config certificate wif


【解决方案1】:

在我的情况下,问题还在于复制指纹并粘贴它会添加一些常规文本编辑器不显示的字符。我发现以下说明对于删除特殊字符非常有用(看 #4)。 posted by Edwin Guru Singh

使用 Visual Studio 删除特殊字符:

  1. 关闭web.config
  2. 右键单击它并使用二进制编辑器打开它
  3. 找到指纹的位置并删除其他字符(所有不是数字的字符,通常是点)。
  4. 保存并重试,它应该可以工作。

【讨论】:

    【解决方案2】:

    正如 MJCoffman 所说,这很可能是因为您复制了带有隐藏字符的指纹。 You can find more details here.

    【讨论】:

    • 来自给定的链接:“当使用证书管理单元和证书 GUI 时,不要从 Richedit 控件复制出现在证书缩略图之前的“额外空间”。”
    【解决方案3】:

    复制您的指纹会添加隐藏的 Unicode 字符。尝试输入。

    【讨论】:

    • 这非常多,我希望我早点发现这个谢谢!
    猜你喜欢
    • 2011-08-15
    • 2014-01-10
    • 1970-01-01
    • 2018-01-18
    • 1970-01-01
    • 1970-01-01
    • 2013-03-08
    • 1970-01-01
    相关资源
    最近更新 更多