ID4175:IssuerNameRegistry无法识别安全令牌的颁发者

问题描述 投票:7回答:3

我正在尝试在开发环境中与我的MVC应用程序一起实现Simple 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
3个回答
17
投票

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


5
投票

正如MJCoffman提到的那样,很可能是因为你复制了带有隐藏字符的指纹。 You can find more details here.


0
投票

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

这样做是为了摆脱使用Visual Studio的特殊字符:

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