我经常遇到这个错误,我的努力没有任何结果.错误:
ID8030:无法解析'type'属性的值.验证'issuerNameRegistry type ="Webapp1.TrustedIssuerNameRegistry,webapp1"元素的type属性是否正确.
这是我的TrustedIssuerNameRegistry类:
namespace Webapp1 { public class TrustedIssuerNameRegistery : IssuerNameRegistry { private string issuerName = string.Empty; public override string GetIssuerName(SecurityToken securityToken) { if (securityToken != null) { X509SecurityToken x509Cert = securityToken as X509SecurityToken; if (x509Cert != null && x509Cert.Certificate.SubjectName.Name == "CN=busta-ip1sts.com") { issuerName = x509Cert.Certificate.SubjectName.Name; } } if (string.IsNullOrEmpty(issuerName)) { throw new SecurityTokenException("Untrusted issuer."); } return issuerName; } public override string GetIssuerName(System.IdentityModel.Tokens.SecurityToken securityToken, string requestedIssuerName) { return base.GetIssuerName(securityToken, requestedIssuerName); } } }
这是我的web.config配置:
尝试将web.config identityConfiguration更改为:
<issuerNameRegistry type="Webapp1.WsFederationRequestValidator, Webapp1" />
看看是否有帮助.另外,请确保System.IdentityModel.Tokens.ValidatingIsserNameRegistry
正确设置您的引用.
您可能需要Microsoft Token Validation Extension for Microsoft .Net Framework 4.5
从NuGet中获取最新信息.