为什么我的STS客户端出现此错误?"无法解析'type'属性的值.验证'issuerNameRegistry的type属性..."

 跟-着感觉走 发布于 2023-02-08 12:41

我经常遇到这个错误,我的努力没有任何结果.错误:

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配置:

  

  
  
    
    
  
  
   

1 个回答
  • 尝试将web.config identityConfiguration更改为:

    <issuerNameRegistry type="Webapp1.WsFederationRequestValidator, Webapp1" />
    

    看看是否有帮助.另外,请确保System.IdentityModel.Tokens.ValidatingIsserNameRegistry正确设置您的引用.

    您可能需要Microsoft Token Validation Extension for Microsoft .Net Framework 4.5从NuGet中获取最新信息.

    2023-02-08 12:44 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有