C# 在WCF服务中实现身份验证(非ssl)
我开发了一个.NETWCF服务,它使用basicHttp绑定。此服务将托管在内部网的IIS中,并由非Windows SAP PO客户端使用 此服务不公开任何敏感信息,因此我不想在签名或加密邮件上花费时间。但是,我也不希望任何知道URL的人访问该服务。因此,需要某种形式的身份验证 谁能告诉我什么是最简单的方式来验证我的服务 更新: 谢谢你,凯乌·帕特尔。我设法按照安全模式设置为“TransportCredentialOnly”时提供的链接在IIS中托管服务 我在IIS中启用了基本身份验证 我的windows客户端能够订阅服务,但在执行操作时收到以下错误 HTTP请求未经客户端身份验证方案“Basic”授权。从服务器接收的身份验证标头为“Basic realm=“MY server NAME”” 服务器配置C# 在WCF服务中实现身份验证(非ssl),c#,wcf,ssl,sap,C#,Wcf,Ssl,Sap,我开发了一个.NETWCF服务,它使用basicHttp绑定。此服务将托管在内部网的IIS中,并由非Windows SAP PO客户端使用 此服务不公开任何敏感信息,因此我不想在签名或加密邮件上花费时间。但是,我也不希望任何知道URL的人访问该服务。因此,需要某种形式的身份验证 谁能告诉我什么是最简单的方式来验证我的服务 更新: 谢谢你,凯乌·帕特尔。我设法按照安全模式设置为“TransportCredentialOnly”时提供的链接在IIS中托管服务 我在IIS中启用了基本身份验证 我的wi
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="CustomAuthentication">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" proxyCredentialType="Basic"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SecurityBehavior">
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="SimpleService.UserNamePasswordAuthentification, App_Code/UserNameValidator"/>
</serviceCredentials>
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="SecurityBehavior" name="SimpleService.SimpleService">
<endpoint address="SimpleService" binding="basicHttpBinding" bindingConfiguration="CustomAuthentication" contract="SimpleService.ISimpleService"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISimpleService">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://MYSERVERNAME:PORT/SimpleService.svc/SimpleService"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISimpleService"
contract="SimpleServiceDEV.ISimpleService" name="BasicHttpBinding_ISimpleService" />
</client>
</system.serviceModel>
</configuration>
客户端配置
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="CustomAuthentication">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" proxyCredentialType="Basic"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SecurityBehavior">
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="SimpleService.UserNamePasswordAuthentification, App_Code/UserNameValidator"/>
</serviceCredentials>
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="SecurityBehavior" name="SimpleService.SimpleService">
<endpoint address="SimpleService" binding="basicHttpBinding" bindingConfiguration="CustomAuthentication" contract="SimpleService.ISimpleService"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISimpleService">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://MYSERVERNAME:PORT/SimpleService.svc/SimpleService"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISimpleService"
contract="SimpleServiceDEV.ISimpleService" name="BasicHttpBinding_ISimpleService" />
</client>
</system.serviceModel>
</configuration>
您是否正在处理后端中的任何数据库?否。服务在其业务逻辑中执行一些基本计算,并以字符串形式返回结果。此链接可能有帮助:。