0

我想做的是将客户端凭据传递给我的 Web 服务,然后我的 Web 服务对 AIF (ax) Web 服务进行身份验证以传递信息。目前我的客户端程序通过 HTTPS 进行身份验证,对我的 Web 服务进行 Windows 身份验证。然后我的 Web 服务连接到 AIF。当前,Web 服务仅作为一般身份帐户运行。但是我希望用户凭据得到传递,所以当在 ax 中创建某些东西时,我们知道它是由用户而不是一般帐户。什么是最简单的方法。
我已经尝试过类似方法的模拟代码。

        <OperationBehavior(Impersonation:=ImpersonationOption.Allowed)>

然后尝试在 windowsidentity 上下文下调用 aif 但我没有运气....当然如果我这样做了

generalJournal.ClientCredentials.Windows.ClientCredential.UserName = ""
             'generalJournal.ClientCredentials.Windows.ClientCredential.Password = ""
                  'generalJournal.ClientCredentials.Windows.ClientCredential.Domain = ""

这行得通...但是我需要获取已经过身份验证的凭据...有什么帮助吗?谢谢

4

1 回答 1

0

在您应该设置servicePrincipalName并启用您的服务帐户以进行委派的服务上。

<configuration>
  <services>
    <service>
      <endpoint>
        <identity>
          <servicePrincipalName value="server/YourService" />
        </identity>
      </endpoint>
    </service>
  </services>
</configuration>

SPNAD

setspn.exe –U –A server/YourService DOMAIN\SERVICEACCOUNT

在客户端配置 ypu 上必须设置userPrincipalName.

<configuration>
  <system.serviceModel>
    <client>
      <endpoint>
        <identity>
          <userPrincipalName value="server/YourService" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>
</configuration>
于 2015-06-18T11:04:31.983 回答