2012-08-15 56 views
2

我在Visual Studio中创建了一个新的WCF安全令牌服务,该服务可以在http上正常运行。 我正在尝试将其配置为通过https运行。我更改了IIS中的目录安全性以要求使用SSL。通过HTTPS的安全令牌服务(STS)

正如我通过http浏览服务时所预期的,我现在收到消息“必须通过安全通道查看页面”。但是,当我通过https浏览到该服务时,我收到一条错误消息:“无法找到与具有绑定WS2007HttpBinding的端点的方案http相匹配的基地址,注册的基地址方案为[https]。”

我假设我必须在web.config文件中有一个我忽略的配置,但我不太确定它是什么。在这件事上任何帮助都会很大。

我的web.config文件如下所示。

<?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"/> 
    <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> 
      <authenticationService enabled="true" requireSSL = "true"/> 
     </webServices> 
    </scripting> 
    </system.web.extensions> 

    <system.serviceModel> 
    <services> 
     <service name="Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract" behaviorConfiguration="ServiceBehavior"> 
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
     <endpoint address="IWSTrust13" binding="ws2007HttpBinding" contract="Microsoft.IdentityModel.Protocols.WSTrust.IWSTrust13SyncContract" bindingConfiguration="ws2007HttpBindingConfiguration"/> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost/DemoSTS/Service.svc" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <bindings> 
     <ws2007HttpBinding> 
     <binding name="ws2007HttpBindingConfiguration"> 
      <security mode="Message"> 
      <message establishSecurityContext="false" /> 
      </security> 
     </binding> 
     </ws2007HttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="ServiceBehavior"> 
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 

回答

0

添加额外的https基地址。

如果你是主人了IIS,你必须配置SSL,并为HTTPS通道分配相应的证书。

相关问题