WCF configuration for multiple site bindings
Im trying to setup my config for my WCF service correctly.
On our web server we are going to have a Service that is both accessible to Extenal internet users and Internal users.
to access the site externally you will go to http://services.ourdomain.com to access the site internally you will go to http://serverna开发者_开发技巧me:9090
I'd like to configure how the users are authenticated. so for external i will use a usernamevalidator and internal for now just have no authentication, but this may change in future.
how can i setup my config file that when access to the service is coming externally it will use the customvalidator but for internal it will just use regular basicHttpBinding?
Try something like this in your service config:
<services>
<service name = "MyService">
<endpoint address = "http://services.ourdomain.com" binding = "customBinding"/>
<endpoint address = "http://servername:9090" binding = "basicBinding"/>
</service>
</services>
<bindings>
<binding name = "basicBinding">
<security mode = "None"/>
</binding>
<binding name = "customBinding">
<security mode = "Message">
<message clientCredentialType="UserName">
</security>
</binding>
</bindings>
精彩评论