2012-11-19 39 views
0

我们有一个WCF-REST服务在http://www.domain.com/service.svc上运行。一家外部公司正在对这个Web服务进行调用,并且由于可以传输敏感数据,我们希望服务能够在SSL下运行并使用基本认证。asp.net基本认证Web服务,如何配置用户名和密码

我们已经运行了SSL,但是我们遇到了基本身份验证问题。 web.config看起来像这样;

<behaviors> 
    <endpointBehaviors> 
    <behavior name="REST"> 
     <webHttp /> 
    </behavior> 
    </endpointBehaviors> 
</behaviors> 

<webHttpBinding> 
    <binding name="webBindingMobile"> 
     <security mode="Transport"> 
     <transport clientCredentialType="Basic" /> 
     </security> 
    </binding> 
    </webHttpBinding> 

    <services> 
     <service name="Website.Mobile.Webservice"> 
     <endpoint address="" behaviorConfiguration="REST" binding="webHttpBinding" contract="Website.PaymentProxy.Services.Proxy.IProxyClientInterface" bindingConfiguration="webBindingMobile" /> 
     </service> 
     <service name="Website.Mobile.ShoppingCartService">    
     <endpoint address="" behaviorConfiguration="REST" binding="webHttpBinding" contract="Website.PaymentProxy.Services.Proxy.Cart.Interfaces.IShoppingCartService" bindingConfiguration="webBindingMobile" /> 
     </service> 
    </services> 

我们想要的只是一个简单的用户名和密码(最好)存储在web.config中。向我们的网络服务打电话的公司应该在他们的代码中输入这些凭据,以便能够拨打我们的服务。我们如何配置这个?

回答

相关问题