Проблемы с использованием net.tcp для STS - PullRequest
2 голосов
/ 28 июля 2010

Я продолжаю получать следующую ошибку, когда пытаюсь получить доступ к конечной точке WCF со ссылкой STS ...

Не удалось проверить входящую политику.В XML-политике не найдено ни одного действительного элемента заявки.

Ниже приведены веб-конфигурации веб-службы STS и WCF ....

Веб-конфигурация STS ...

<?xml version="1.0" encoding="UTF-8"?>

<configuration>
<appSettings>
<add key="IssuerName" value="ActiveSTS"/>
<add key="SigningCertificateName" value="CN=STSTestCert"/>
<add key="EncryptingCertificateName" value="CN=DefaultApplicationCertificate"/>
</appSettings>

<connectionStrings />

<location path="FederationMetadata">
<system.web>
  <authorization>
    <allow users="*"/>
  </authorization>
</system.web>
</location>

<system.web>
<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </assemblies>
</compilation>
<authentication mode="None"> </authentication>

<pages>
  <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions,     Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </controls>
</pages>
</system.web>

<system.web.extensions>
<scripting>
  <webServices />
</scripting>
</system.web.extensions>

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<diagnostics>
  <messageLogging
logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logEntireMessage="true"
logMessagesAtTransportLevel="true"/>
</diagnostics>

<services >
  <service behaviorConfiguration="ServiceBehavior"
    name="Samples.Security.STS.SecurityTokenService">
    <!-- Mutual X509 Endpoint -->

    <endpoint
 binding="customBinding"
 address=""
 bindingConfiguration="MutualCertificateBinding"
 contract="Samples.Security.STS.ISecurityTokenService">
    </endpoint>

    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:8100/sts/"  />
      </baseAddresses>
    </host>
  </service>
</services>

<bindings>
  <customBinding>
    <binding name="MutualCertificateBinding">
      <security allowInsecureTransport="true" securityHeaderLayout="Lax" enableUnsecuredResponse="true" >
      </security>
      <binaryMessageEncoding/>
      <tcpTransport />
    </binding>
  </customBinding>
</bindings>


<behaviors >
  <serviceBehaviors>

    <behavior name="ServiceBehavior">

      <serviceMetadata httpGetEnabled="True" httpGetUrl="http://localhost:8831/sts/" />


      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

</system.serviceModel> 

</configuration>

WCF Web Config ...

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="microsoft.identityModel"     type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection,     Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"     />
  </configSections>
      <location path="FederationMetadata">
        <system.web>
          <authorization>
            <allow users="*" />
          </authorization>
        </system.web>
      </location>
      <system.web>
        <compilation debug="true" targetFramework="4.0">
          <assemblies>
            <add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral,     PublicKeyToken=31BF3856AD364E35" />
          </assemblies>
        </compilation>
      </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <federatedServiceHostConfiguration />
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />          
          <serviceCredentials>
            <serviceCertificate findValue="A3A4D95F1E40D274541EF53D5C9B672F00F41B36" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" />
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true" />
    <extensions>
      <behaviorExtensions>
        <add name="federatedServiceHostConfiguration" type="Microsoft.IdentityModel.Configuration.ConfigureServiceHostBehaviorExtensionElement, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </behaviorExtensions>
    </extensions>
    <protocolMapping>
      <add scheme="http" binding="ws2007FederationHttpBinding" />
    </protocolMapping>
    <bindings>
      <customBinding>
        <binding>
          <security allowInsecureTransport="true" securityHeaderLayout="Lax" enableUnsecuredResponse="true">
          </security>
          <binaryMessageEncoding />
          <tcpTransport />
        </binding>
      </customBinding>
      <ws2007FederationHttpBinding>
        <binding>
          <security mode="Message">
            <message>
              <issuerMetadata address="http://localhost:11558/JonsFoodInformationService_STS/Service.svc/mex" />
              <claimTypeRequirements>
                <add claimType="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" isOptional="true" />
                <add claimType="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" isOptional="true" />

              </claimTypeRequirements>
            </message>
          </security>
       </binding>
      </ws2007FederationHttpBinding>
    </bindings>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
  <microsoft.identityModel>
    <service>
      <audienceUris>
        <add value="http://localhost:15796/FoodOfTheMonthService.svc" />
      </audienceUris>
      <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <trustedIssuers>
          <add thumbprint="2ABE4F1A98C12363F3A654E76F211F62895DBE65" name="net.tcp://localhost:8000/sts/Service.svc" />
        </trustedIssuers>
      </issuerNameRegistry>
    </service>
  </microsoft.identityModel>
  <appSettings>
    <add key="FederationMetadataLocation" value="C:\JonsAttempt - Try 5 WOrked - Copy\JonsFoodInformationService_STS\FederationMetadata\2007-06\FederationMetadata.xml" />
  </appSettings>
</configuration>

Любая помощь очень ценится!

1 Ответ

0 голосов
/ 10 ноября 2011

это обычно означает, что STS не предоставляет заявки, необходимые для доступа к целевой службе.

...