Why does my STS client get this error? "The value of the 'type' property could not be parsed.Verify that the type attribute of 'issuerNameRegistry..."
Asked Answered
T

1

6

I frequently encounter this error and my efforts had not any result. Error :

ID8030: The value of the 'type' property could not be parsed.Verify that the type attribute of 'issuerNameRegistry type="Webapp1.TrustedIssuerNameRegistry,webapp1" element is correct.

This is my TrustedIssuerNameRegistry class :

    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);
        }
    }
}

And this is my web.config configuration :

  <system.identityModel>
<identityConfiguration>
  <certificateValidation certificateValidationMode="PeerTrust" trustedStoreLocation="LocalMachine" revocationMode="Online"/>
  <audienceUris>
    <add value="http://localhost:7382/"/>
    <add value="http://localhost:50466/"/>
  </audienceUris>
  <issuerNameRegistry type="Webapp1.WsFederationRequestValidator"></issuerNameRegistry>
   </identityConfiguration>

Toddle answered 24/12, 2013 at 11:43 Comment(0)
C
13

Try changing your web.config identityConfiguration to this:

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

and see if that helps. Also, make sure your reference to System.IdentityModel.Tokens.ValidatingIsserNameRegistry is correctly setup.

You may have to pull the latest Microsoft Token Validation Extension for Microsoft .Net Framework 4.5 from NuGet.

Curlicue answered 12/1, 2014 at 22:12 Comment(1)
This was the solution for my problem: Specifically, System.IdentityModel.Tokens.ValidatingIsserNameRegistry is not in the Reference Assemblies path. So you have to get it from somewhere and then reference it by path (which is what NuGet does for you if you use it).Bower

© 2022 - 2024 — McMap. All rights reserved.