支持WCF互操作性Kerberos SPNego的Web服务

支持WCF互操作性Kerberos SPNego的Web服务,wcf,soap,active-directory,wcf-client,spnego,Wcf,Soap,Active Directory,Wcf Client,Spnego,我们有一个测试Windows Server 2012域。有两台计算机是此域的成员 Oracle公司正在开发一台计算机,并在虚拟机上运行Linux版本。此计算机正在托管一个SPNego Kerberos身份验证Web服务,该服务可能由IBM WebSphere托管 另一台计算机是托管在Microsoft虚拟机上的Windows XP客户端 我们在Active Directory内部创建了SPN,以使用Kerberos对用户进行身份验证 然后,我们使用浏览器测试Web服务。WSDL地址完美地返回了S

我们有一个测试Windows Server 2012域。有两台计算机是此域的成员

Oracle公司正在开发一台计算机,并在虚拟机上运行Linux版本。此计算机正在托管一个SPNego Kerberos身份验证Web服务,该服务可能由IBM WebSphere托管

另一台计算机是托管在Microsoft虚拟机上的Windows XP客户端

我们在Active Directory内部创建了SPN,以使用Kerberos对用户进行身份验证

然后,我们使用浏览器测试Web服务。WSDL地址完美地返回了SOAP数据

Kerberos已关闭,因此可以将客户端代理代码合并到WCF 4.0客户端中,并再次打开以测试身份验证

但是,当尝试使用客户端代理中提供的方法连接到Web服务时,会引发各种与安全相关的错误:

The remote HTTP server did not satisfy the mutual authentication requirement. The remote server returned an error: (405) Method Not Allowed. 远程HTTP服务器不满足相互身份验证要求。 远程服务器返回错误:(405)方法不允许。 下面是用于连接到Web服务的客户端App.config文件:

<configuration>
<system.serviceModel>
    <client>
        <endpoint address="http://oag:8080/pos/GetStoreConfigurationService"
                  binding="wsFederationHttpBinding"
                  bindingConfiguration="wsFederationHttpBinding_ESLGetStoreConfigurationBinding"
                  behaviorConfiguration="ServiceBehavior"
                  contract="ESLGetStoreConfigurationPortType"
                  name="wsFederationHttpBinding_ESLGetStoreConfigurationPort" >
            <identity>
                <servicePrincipalName value="http/oag:8080"/>
            </identity>
        </endpoint>
    </client>
    <bindings>
        <customBinding>
            <binding name="UsernameBinding">
                <binaryMessageEncoding />
                <security authenticationMode="Kerberos"  
                          requireSecurityContextCancellation ="false"
                          requireSignatureConfirmation="false" 
                          messageProtectionOrder ="EncryptBeforeSign"
                          requireDerivedKeys="false" 
                          enableUnsecuredResponse="true" 
                          allowInsecureTransport="true" 
                          securityHeaderLayout="Lax" >
                </security>
                <httpTransport authenticationScheme="Negotiate"  
                               transferMode="Buffered" 
                               maxReceivedMessageSize="67819876"/>
            </binding>
        </customBinding>
        <wsFederationHttpBinding>
            <binding name="wsFederationHttpBinding_ESLGetStoreConfigurationBinding" >
                <security mode="Message">
                    <message negotiateServiceCredential="true" 
                             establishSecurityContext="false"
                             algorithmSuite="Basic128" >
                        <issuer address="http://192.168.100.25" 
                                bindingConfiguration="UsernameBinding"
                                binding="customBinding">
                            <identity>
                                <dns value="WIN-7TN6ALB4TVK.oag-dev.sei"/>
                            </identity>
                        </issuer>
                    </message>
                </security>
            </binding>
        </wsFederationHttpBinding>
    </bindings>
    <behaviors>
        <endpointBehaviors>
            <behavior name="ServiceBehavior">
                <clientCredentials>
                    <windows allowedImpersonationLevel="Identification"/>
                </clientCredentials>
            </behavior>
        </endpointBehaviors>
    </behaviors>
</system.serviceModel>
<system.web>
    <identity impersonate="false" userName="oag-server" password="Password!"/>
</system.web>

提供网络凭证也是在代码中完成的;但是,唉,没有用


谢谢。

如果您能获得一个堆栈生成的示例工作请求/响应对(或spnego情况下的多条消息)(例如,客户机和服务器都是java),则是最好的选择。然后,这将是一个将WCF调整为这些消息之一的游戏。目前有太多的未知。此外,AFAIK SPNEGO是一种仅支持WCF的协议(=SOAP消息级别的windows凭据协商),因此服务器可能使用其他协议


您得到的特定错误可能暗示服务器在发送SOAP12时使用SOAP11(例如,您可能需要基本http绑定)。但是,任何配置更改都必须在了解服务器允许哪些SOAP的情况下进行。

感谢您快速而简洁的响应。我将与Oracle进行核对,找出他们使用的SOAP的确切版本,事实上,我会将他们引向这篇文章以供进一步思考。