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

问题描述 投票:0回答:1

我们有一个测试 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.

用于连接到 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>

提供网络凭证也是通过代码完成的;但没有效果。

wcf soap active-directory wcf-client spnego
1个回答
1
投票

最好的是,如果您可以获得由一个堆栈(例如客户端和服务器是 java)生成的示例工作请求/响应对(或 spnego 情况下的多条消息)。然后,这将是一场将 WCF 调整为其中一条消息的游戏。目前还有太多的未知数。另外,据我所知,SPNEGO 是仅支持 WCF 的协议(= SOAP 消息级别的 Windows 凭据协商),因此服务器可能使用其他协议。

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

© www.soinside.com 2019 - 2024. All rights reserved.