【问题标题】:PSI authentication only returns 401PSI 身份验证仅返回 401
【发布时间】:2011-10-24 17:47:49
【问题描述】:

我正在开发一个网络服务,它将成为许多应用程序和 PSI 之间的“看门人”。问题是“许多应用程序”将提供登录名/密码,并且网络服务必须根据 PSI 对它们进行身份验证。但无论我做什么,当我调用“PSIFormsLogin.Login(user,password)”方法时,我总是会收到 401 Unauthorized 错误...我什至使用了运行农场的用户...

我也已经遵循以下 MS 教程:http://msdn.microsoft.com/en-us/library/ff181538.aspx

最后我想做的就是验证使用 PSI 网络服务提供的帐户/密码,谁能告诉我我做错了什么???

PS:不是 WCF

新信息:发生了一些有趣的事情。我故意将 URL 切换为不存在的:http://myserver/pwa/_vti_bin/psi/bla.asmx,但我仍然得到 401...

【问题讨论】:

    标签: web-services visual-studio-2010 ms-project-server-2010


    【解决方案1】:

    确保您已像这样修改了应用程序的 web.config。只需覆盖绑定节点中的安全节点:

    <binding name="WssInteropSoap">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm"
            realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
    

    现在您可以在没有特殊帐户的情况下进行身份验证(从 Windows 中通过)或使用此代码,您可以指定一个帐户:

    //credential impersonation (just if you changed your binding settings)
    projectSvc.ClientCredentials.Windows.ClientCredential = new NetworkCredential("username", "password", "domain");
    projectSvc.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
    

    我希望它会有所帮助:)

    但是,我从未听说过名为“PSIFormsLogin.Login”的函数

    也许我关于使用 C# 建立与 PSI 的连接的博客文章对您来说很有趣:Read Project Server 2010 CustomFields over PSI

    【讨论】:

      猜你喜欢
      • 2019-09-13
      • 2017-09-05
      • 2016-10-02
      • 2023-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多