Reputation: 21
I am getting the below error when trying to navigate to a service we have created and installed:
An error occurred creating the configuration section handler for system.identityModel: ID7029: Duplicate 'identityConfiguation' configuration element with the name '' was found in the 'system.identityModel' configuration section.
Line 74: <validation validateIntegratedModeConfiguration="false" />
Line 75: </system.webServer>
**Line 76: <system.identityModel>**
Line 77: <identityConfiguration name="">
Line 78: <claimsAuthenticationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceClaimsAuthenticationManager, Sage.IdentityModel.Claims.Sage200" />
Here is the web.config being used:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=***"/>
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=***"/>
<section name="sage.identityModel.tokens.sageID" type="Sage.IdentityModel.Tokens.SageID.Configuration.ModuleConfigurationSection, Sage.IdentityModel.Tokens.SageID"/>
</configSections>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<add key="credentialsFile" value="c:\sage\logon\credentials.xml" />
<add key="Sage200SiteLogonPath" value="c:\Sage\Logon" />
<add key="ServerRootPath" value="C:\Sage" />
<add key="SystemAdministration" value="Local" />
<add key="Sage200Path" value="C:\inetpub\Sage 200 App Services\Sage200Services\Bin\" />
</appSettings>
<system.web>
<compilation targetFramework="4.0" />
<trust level="Full" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultAuthorizationBehavior">
<serviceThrottling
maxConcurrentCalls="16"
maxConcurrentSessions="20"
maxConcurrentInstances="16" />
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceAuthorization principalPermissionMode ="Always" />
<serviceCredentials useIdentityConfiguration="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<bindings>
<basicHttpBinding>
<binding name="SecureHttpBinding"
maxBufferPoolSize="104857600"
maxReceivedMessageSize="104857600"
maxBufferSize="104857600"
transferMode="Buffered">
<security mode="Transport">
<transport clientCredentialType ="Windows" />
</security>
<readerQuotas maxDepth="32"
maxStringContentLength="104857600"
maxArrayLength="104857600"
maxBytesPerRead="4096"
maxNameTableCharCount="16384"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="SageWebService.Service1"
behaviorConfiguration="DefaultAuthorizationBehavior">
<endpoint address="https://SERVERNAME:PORT/SageWebService/Service1.svc"
binding="basicHttpBinding"
bindingConfiguration="SecureHttpBinding"
contract="SageWebService.IService1"
listenUri="/" />
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ApplicationInsightsWebTracking"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
preCondition="managedHandler"/>
</modules>
<directoryBrowse enabled="true"/>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
<system.identityModel>
<identityConfiguration>
<claimsAuthenticationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceClaimsAuthenticationManager, Sage.IdentityModel.Claims.Sage200"/>
<claimsAuthorizationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceThirdPartyClaimsAuthorizationManager, Sage.IdentityModel.Claims.Sage200"/>
</identityConfiguration>
</system.identityModel>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\log\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
I can't see anywhere else that is defining an identity configuration section in this config or the machine.config on the server. I have tried giving a unique name to the identity configuration section but the issue still happens.
The app pool is using .net v4.0 and the service is targeting v4.5.2
Is there anywhere I should be looking for this, or does the error mean something else is wrong?
Thanks,
Upvotes: 0
Views: 1303
Reputation: 1
When I ran into this issue it was another site I was using in my IIS under the default web site. I moved the page to its own site in IIS and it ran fine, however I cannot have both sites routed through the same port at the same time. It works when one is off or if you use different ports (like http (port 80) for one and https (port 443) for the other).
Upvotes: 0
Reputation: 21
For anyone that may see this in the future I have gotten around this issue by updating the Identity Model section to be:
<system.identityModel>
<remove name="SageIdentity"/>
<identityConfiguration name="SageIdentity">
<claimsAuthenticationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceClaimsAuthenticationManager, Sage.IdentityModel.Claims.Sage200" />
<claimsAuthorizationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceThirdPartyClaimsAuthorizationManager, Sage.IdentityModel.Claims.Sage200" />
</identityConfiguration>
</system.identityModel>
Upvotes: 2