【发布时间】: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